Index: llvm/lib/IR/ConstantFold.cpp =================================================================== --- llvm/lib/IR/ConstantFold.cpp +++ llvm/lib/IR/ConstantFold.cpp @@ -972,6 +972,8 @@ (isa(C1) || isa(C2)); if (HasScalarUndef) { switch (static_cast(Opcode)) { + default: + llvm_unreachable("Invalid BinaryOp"); case Instruction::Xor: if (isa(C1) && isa(C2)) // Handle undef ^ undef -> 0 special case. This is a common @@ -1067,8 +1069,6 @@ // NaN because we can choose the undef operand as NaN, and any FP opcode // with a NaN operand will propagate NaN. return ConstantFP::getNaN(C1->getType()); - case Instruction::BinaryOpsEnd: - llvm_unreachable("Invalid BinaryOp"); } }