[llvm] [ExtendLifetimes] Implement llvm.fake.use to extend variable lifetimes (PR #86149)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 07:52:34 PDT 2024


SLTozer wrote:

It ended up taking a little longer than I expected to make the AsmPrinter changes; I couldn't see a sensible place to put the "remove loads feeding into fake use" behaviour, so I made it into a pass. The main goal here was to have this take place very late, so that no subsequent pass takes advantage of the removed load/fake_use to shorten the stack lifetime of a variable, but before LiveDebugValues, so that LDV has an accurate understanding of which machine locations house the required values.

The pass itself runs only if the function has `optdebug` enabled, since those should be the only functions with fake uses (tests have been updated to reflect this); it's not an error if we don't run this pass for a function that has fake use instructions though. I'm happy to move it to a separate patch if it makes it easier for reviewers - even outside of test files, this patch is already very large.

https://github.com/llvm/llvm-project/pull/86149


More information about the llvm-commits mailing list