summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKay Tiong Khoo <kkhoo@perfwizard.com>2013-12-02 22:23:32 +0000
committerKay Tiong Khoo <kkhoo@perfwizard.com>2013-12-02 22:23:32 +0000
commitddc7eef2cd6c098403edcc5f32b9be82bf726555 (patch)
tree8669c68ccdeeef3f338a93c8b852e625c5d9ccc9 /lib
parent3059b474a48d4c34eb327e7f30b4de6e3d31d97a (diff)
downloadllvm-ddc7eef2cd6c098403edcc5f32b9be82bf726555.tar.gz
llvm-ddc7eef2cd6c098403edcc5f32b9be82bf726555.tar.bz2
llvm-ddc7eef2cd6c098403edcc5f32b9be82bf726555.tar.xz
Use local variable for repeated use rather than 'get' method. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index a40545115d..150450a870 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1226,15 +1226,14 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
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::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
} 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);