diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 4c8340c98fa093..814881da3c3a5b 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -1262,14 +1262,14 @@ static Value *SimplifyShift(Instruction::BinaryOps Opcode, Value *Op0, // If any bits in the shift amount make that value greater than or equal to // the number of bits in the type, the shift is undefined. - KnownBits Known = computeKnownBits(Op1, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); - if (Known.getMinValue().uge(Known.getBitWidth())) + KnownBits KnownAmt = computeKnownBits(Op1, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); + if (KnownAmt.getMinValue().uge(KnownAmt.getBitWidth())) return PoisonValue::get(Op0->getType()); // If all valid bits in the shift amount are known zero, the first operand is // unchanged. - unsigned NumValidShiftBits = Log2_32_Ceil(Known.getBitWidth()); - if (Known.countMinTrailingZeros() >= NumValidShiftBits) + unsigned NumValidShiftBits = Log2_32_Ceil(KnownAmt.getBitWidth()); + if (KnownAmt.countMinTrailingZeros() >= NumValidShiftBits) return Op0; return nullptr;