[PATCH] D106352: [InstCombine] Fold (select C, (gep (gep Ptr, Idx0), Idx1), (gep Ptr, Idx0)) -> (gep Ptr, (select C, Idx0+Idx1, Idx0)) (PR51069)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 05:17:03 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2958
+      NewT =
+          Builder.CreateAdd(Idx, BaseGep->getOperand(1), SI.getName() + ".add");
+      NewF = BaseGep->getOperand(1);
----------------
RKSimon wrote:
> RKSimon wrote:
> > Something that I've noticed while trying to get this tested with alive2 - I think we need to guarantee that the add won't overlap?
> [EDIT] Something that I've noticed while trying to get this tested with alive2 - I think we need to guarantee that the add won't overflow?
[[ https://alive2.llvm.org/ce/z/f8pLfD | No? ]]


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106352/new/

https://reviews.llvm.org/D106352



More information about the llvm-commits mailing list