[PATCH] D125485: [ArgPromotion] Unify byval promotion with non-byval
Pavel Samolysov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 17 05:12:09 PDT 2022
psamolysov added a comment.
I've implemented the approach proposed by @nikic (thank you again and again!) What I see, after `PromoteMemToReg`, some new inserted function arguments might become unused (so, there are no users for the argument after promotion). Theoretically, we can move the code that generates `GEP`s and `load`s in the callers after the code that makes promotion in the callee and take those unused argument into account (so, just not to generate the instructions for such arguments) but it requires to generate a new (more new than already generated `NF`) definition of the callee without the unused arguments. I tried and it makes the code of the pass very difficult to read and understand, so I believe this is a job for another pass in IPO (and maybe this pass already exists) in pair with DCE.
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