nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM

We should give this a try, but I think there is a fairly large chance that this 
will cause regressions somewhere and a more targeted change may be necessary 
(e.g. only do this for loop-invariants in LICM).



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2334-2335
+      Value *Ptr = GEP.getPointerOperand();
+      auto *NewPtr = GetElementPtrInst::Create(GEP.getResultElementType(), Ptr,
+                                               Idx1, "", &GEP);
+      return GetElementPtrInst::Create(GEP.getResultElementType(), NewPtr,
----------------
IRBuilder needs to be used for all but the last instruction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155688

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to