[PATCH] D146327: [ArgPromotion] Remove dead code produced by removing dead arguments

Jeffrey Byrnes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 12:36:47 PDT 2023


jrbyrnes updated this revision to Diff 507474.
jrbyrnes added a comment.

Rebase to show diff.

Summary of impact on PhaseOrdering test: During argPromotion of @phantomLoad, we introduce some loads of %this in @badChild. In a subsequent iteration of doPromotion we remove dead %this from @phantomLoad argument. This patch removes also the dead loads in @badChild. This allows argPromotion of @badChild to promote %this which cleans up the if.then and if.else blocks a bit. Then, MergedLoadStoreMotion is able to completely sink the CFG due to cleaned structure, and SimplifyCFG is able to remove it altogether.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146327

Files:
  llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  llvm/test/Transforms/ArgumentPromotion/propagate-remove-dead-args.ll
  llvm/test/Transforms/ArgumentPromotion/store-into-inself.ll
  llvm/test/Transforms/PhaseOrdering/dce-after-argument-promotion-loads.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146327.507474.patch
Type: text/x-patch
Size: 6646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230322/40a861ad/attachment.bin>


More information about the llvm-commits mailing list