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

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 05:06:35 PDT 2024


SLTozer wrote:

Apologies for the delay on updating this patch, my attention has been elsewhere for a while. I've added GlobalISel support that seems to work - in the new and updated `check-fake-use.py`, we test that we can successfully extend the lifetimes of variables for `--global-isel=1 -mtriple=aarch64--linux-gnu`.

Re: `check-fake-use.py`, I agree that it's not ideal to need a script for this. Having looked a little more at it, I've changed the script so that instead of checking that the variable's location range covers from `DW_AT_low_pc` to within 16 bytes of `DW_AT_high_pc`, we check that the variable's location range covers at least from `prologue_end`* to `epilogue_begin`. We could get rid of the python script if we currently had a measurement in LLVM for "scope bytes covered excluding prologue/epilogue", but we don't, so for now I think this needs to stay.

* It might make sense to use `DW_AT_low_pc` rather than `prologue_end` when talking about parameter lifetimes, but for the ARM GlobalISel version the prologue precedes the first `DBG_VALUE` instruction (and this is correct by IR semantics imo!) so I chose `prologue_end` in this case.

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


More information about the llvm-commits mailing list