diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp index 27de238cbe2d1e..f15f1b1823f4f0 100644 --- a/llvm/lib/CodeGen/SelectOptimize.cpp +++ b/llvm/lib/CodeGen/SelectOptimize.cpp @@ -159,7 +159,7 @@ class SelectOptimizeImpl { /// Invert the select by inverting the condition and switching the operands. void setInverted() { - assert(!Inverted && "Trying to invert and inverted SelectLike"); + assert(!Inverted && "Trying to invert an inverted SelectLike"); assert(isa(getCondition()) && cast(getCondition())->getOpcode() == Instruction::Xor); @@ -193,6 +193,8 @@ class SelectOptimizeImpl { /// condition of a select or c in `or(zext(c), x)` Value *getCondition() const { Value *CC = getNonInvertedCondition(); + // For inverted conditions the CC is checked above to be a not / xor + // instruction. if (Inverted) return cast(CC)->getOperand(0); return CC;