[llvm] r196164 - Use local variable for repeated use rather than 'get' method. No functional change intended.

Kay Tiong Khoo kkhoo at perfwizard.com
Mon Dec 2 14:23:32 PST 2013


Author: kkhoo
Date: Mon Dec  2 16:23:32 2013
New Revision: 196164

URL: http://llvm.org/viewvc/llvm-project?rev=196164&view=rev
Log:
Use local variable for repeated use rather than 'get' method. No functional change intended.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=196164&r1=196163&r2=196164&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Mon Dec  2 16:23:32 2013
@@ -1226,15 +1226,14 @@ Instruction *InstCombiner::visitICmpInst
 
         if (CanFold) {
           Constant *NewCst;
-          if (Shift->getOpcode() == Instruction::Shl)
+          if (ShiftOpcode == Instruction::Shl)
             NewCst = ConstantExpr::getLShr(RHS, ShAmt);
           else
             NewCst = ConstantExpr::getShl(RHS, ShAmt);
 
           // Check to see if we are shifting out any of the bits being
           // compared.
-          if (ConstantExpr::get(Shift->getOpcode(),
-                                       NewCst, ShAmt) != RHS) {
+          if (ConstantExpr::get(ShiftOpcode, NewCst, ShAmt) != RHS) {
             // If we shifted bits out, the fold is not going to work out.
             // As a special case, check to see if this means that the
             // result is always true or false now.
@@ -1245,7 +1244,7 @@ Instruction *InstCombiner::visitICmpInst
           } else {
             ICI.setOperand(1, NewCst);
             Constant *NewAndCst;
-            if (Shift->getOpcode() == Instruction::Shl)
+            if (ShiftOpcode == Instruction::Shl)
               NewAndCst = ConstantExpr::getLShr(AndCst, ShAmt);
             else
               NewAndCst = ConstantExpr::getShl(AndCst, ShAmt);





More information about the llvm-commits mailing list