[InstCombine][NFC] Use SimplifyAddInst() instead of SimplifyBinOp(Instruction::Binary...
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 10 Aug 2019 19:29:10 +0000 (19:29 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 10 Aug 2019 19:29:10 +0000 (19:29 +0000)
llvm-svn: 368521

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

index f82a5b1..46294ad 100644 (file)
@@ -3343,8 +3343,8 @@ foldShiftIntoShiftInAnotherHandOfAndInICmp(ICmpInst &I, const SimplifyQuery SQ,
   }
 
   // Can we fold (XShAmt+YShAmt) ?
-  Value *NewShAmt = SimplifyBinOp(Instruction::BinaryOps::Add, XShAmt, YShAmt,
-                                  SQ.getWithInstruction(&I));
+  Value *NewShAmt = SimplifyAddInst(XShAmt, YShAmt, /*IsNSW=*/false,
+                                    /*IsNUW=*/false, SQ.getWithInstruction(&I));
   if (!NewShAmt)
     return nullptr;
   // Is the new shift amount smaller than the bit width?