[llvm] 18b9fc4 - [InstructionSimplify] SimplifyShift - rename shift amount KnownBits. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 10:13:38 PST 2021


Author: Simon Pilgrim
Date: 2021-02-23T18:12:59Z
New Revision: 18b9fc48f1b64061699533740dd6218c982f5b58

URL: https://github.com/llvm/llvm-project/commit/18b9fc48f1b64061699533740dd6218c982f5b58
DIFF: https://github.com/llvm/llvm-project/commit/18b9fc48f1b64061699533740dd6218c982f5b58.diff

LOG: [InstructionSimplify] SimplifyShift - rename shift amount KnownBits. NFCI.

As suggested on D97305.

Added: 
    

Modified: 
    llvm/lib/Analysis/InstructionSimplify.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 4c8340c98fa0..814881da3c3a 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;


        


More information about the llvm-commits mailing list