diff --git a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp index ca0d056e58cb..6cda6d257dc1 100644 --- a/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp +++ b/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp @@ -350,6 +350,7 @@ namespace { } break; case Instruction::Xor: { ConstantIntegral *CI = dyn_cast(V1); + if (!CI) break; if (CI->isAllOnesValue()) { if (BO->getOperand(0) == V1) add(Opcode, ConstantBool::getFalse(), BO->getOperand(1), false);