[PATCH] D125485: [ArgPromotion] Unify byval promotion with non-byval

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 03:29:28 PDT 2022


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

LGTM



================
Comment at: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:402
+        NewLI->takeName(LI);
+        LI->replaceAllUsesWith(NewLI);
         DeadInsts.push_back(LI);
----------------
Just realized that we can probably just do a `LI->setOperand(0, GetAlloca(Ptr))` here and don't really need to create a new instruction and RAUW.


================
Comment at: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:632
 
-  // Make sure the parts are non-overlapping.
-  // TODO: As we're doing pure load promotion here, overlap should be fine from
----------------
The first line of this comment can be kept.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125485



More information about the llvm-commits mailing list