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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 04:41:31 PDT 2021


RKSimon 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);
----------------
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?


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