]> granicus.if.org Git - llvm/commitdiff
[InstSimplify] Move a variable declaration to make simplifyAndOfICmps look more like...
authorCraig Topper <craig.topper@gmail.com>
Fri, 26 May 2017 19:04:02 +0000 (19:04 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 26 May 2017 19:04:02 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304023 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InstructionSimplify.cpp

index 38a9b22c1028f42946806e9430c308d4a9a58aa1..6033d3fe500fb77f7a5312e5e90a2ee7c4a00f84 100644 (file)
@@ -1567,7 +1567,6 @@ static Value *simplifyAndOfICmps(ICmpInst *Op0, ICmpInst *Op1) {
     return X;
 
   // (icmp (add V, C0), C1) & (icmp V, C0)
-  Type *ITy = Op0->getType();
   ICmpInst::Predicate Pred0, Pred1;
   const APInt *C0, *C1;
   Value *V;
@@ -1581,6 +1580,7 @@ static Value *simplifyAndOfICmps(ICmpInst *Op0, ICmpInst *Op1) {
   if (AddInst->getOperand(1) != Op1->getOperand(1))
     return nullptr;
 
+  Type *ITy = Op0->getType();
   bool isNSW = AddInst->hasNoSignedWrap();
   bool isNUW = AddInst->hasNoUnsignedWrap();