[PATCH] D32946: [InstCombine] Merge duplicate functionality between InstCombine and ValueTracking

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 7 19:29:39 PDT 2017


craig.topper added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineInternal.h:510
 
-  void computeKnownBits(Value *V, KnownBits &Known,
-                        unsigned Depth, Instruction *CxtI) const {
+  void computeKnownBits(const Value *V, KnownBits &Known,
+                        unsigned Depth, const Instruction *CxtI) const {
----------------
Can you split the const correcting stuff out into a separate patch?


================
Comment at: lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:426
         if (ConstantExpr::getZExt(CI, I.getType()) == Op1C &&
-            computeOverflowForUnsignedMul(Op0Conv->getOperand(0), CI, &I) ==
-                OverflowResult::NeverOverflows) {
+            WillNotOverflowUnsignedMul(Op0Conv->getOperand(0), CI, I)) {
           // Insert the new, smaller mul.
----------------
If we're adding new methods, let's follow coding standards and start with a lower case letter.


https://reviews.llvm.org/D32946





More information about the llvm-commits mailing list