[PATCH] D27413: Simplify gep (gep p, a), (b-a)

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 11:53:34 PST 2016

davide added inline comments.

Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:1566-1570
+      Value* Sum = SimplifyAddInst(GO1, SO1, false, false, DL, &TLI, &DT, &AC);
+      // Only do the combine when we are sure the cost after the
+      // merge is never more than that before the merge.
+      if (Sum == nullptr)
+        return nullptr;
You can fold the `SimplifyAddInst` inside the if, no?


More information about the llvm-commits mailing list