- // If this is <, >, or !=, we can change this into a simple xor instruction
- if (!isTrueWhenEqual(I))
- return BinaryOperator::createXor(Op0, Op1);
-
- // Otherwise we need to make a temporary intermediate instruction and insert
- // it into the instruction stream. This is what we are after:
- //
- // seteq bool %A, %B -> ~(A^B)
- // setle bool %A, %B -> ~A | B
- // setge bool %A, %B -> A | ~B
- //
- if (I.getOpcode() == Instruction::SetEQ) { // seteq case
+ switch (I.getOpcode()) {
+ default: assert(0 && "Invalid setcc instruction!");
+ case Instruction::SetEQ: { // seteq bool %A, %B -> ~(A^B)