From ecbca9f5fb7d7613d2b94982c4825eb0d33d6842 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 5 Feb 2022 19:04:23 +0100 Subject: Vendor import of llvm-project main llvmorg-14-init-18294-gdb01b123d012, the last commit before the upstream release/14.x branch was created. --- llvm/lib/Analysis/InstructionSimplify.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp') diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index b71b39334ace..4775340b3438 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -951,7 +951,7 @@ static Value *simplifyDivRem(Instruction::BinaryOps Opcode, Value *Op0, // X / undef -> poison // X % undef -> poison - if (Q.isUndefValue(Op1)) + if (Q.isUndefValue(Op1) || isa(Op1)) return PoisonValue::get(Ty); // X / 0 -> poison @@ -2418,6 +2418,10 @@ static Value *SimplifyXorInst(Value *Op0, Value *Op1, const SimplifyQuery &Q, if (Constant *C = foldOrCommuteConstant(Instruction::Xor, Op0, Op1, Q)) return C; + // X ^ poison -> poison + if (isa(Op1)) + return Op1; + // A ^ undef -> undef if (Q.isUndefValue(Op1)) return Op1; -- cgit v1.3