[InstructionSimplify] SimplifyShift - rename shift amount KnownBits. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 23 Feb 2021 18:08:32 +0000 (18:08 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 23 Feb 2021 18:12:59 +0000 (18:12 +0000)
As suggested on D97305.

llvm/lib/Analysis/InstructionSimplify.cpp

index 4c8340c..814881d 100644 (file)
@@ -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;