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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 13:19:32 PDT 2023


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

LGTM

Thanks for the PhaseOrdering test, I think I get the problem now. ArgPromotion is the first pass in the CGSCC pipeline, and works a bit unusually in that promotion will insert loads in the caller (outside the current SCC). This means the we run ArgPromotion on a child function, which inserts instructions in the parent and simplify the child. Then we run ArgPromotion on the parent, but at this point the parent has not been simplified yet. As such, it is important for ArgPromotion to clean up instructions it inserts. There's possibly some phase ordering improvement we could make here, but I don't see anything obvious. (Just moving ArgPromotion to the end of the CGSCC pipeline would cause the reverse issue that function simplification can not make use of the promotion for cleanup.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146327



More information about the llvm-commits mailing list