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

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 04:04:37 PDT 2024


SLTozer wrote:

> A prologue begin/end solution only applies to top level locals in a function, right?

Yes, the main point here is about what's needed to test this specific case more than a general point about `llvm-dwarfdump --statistics`, although there are several things that could be improved about that measurement as you've suggested. I think to summarize, there is a larger scale problem of how to measure debug scope coverage, and a smaller problem of how to determine whether -fextend-lifetimes has worked, which is conceptually simple (does the variable have a `DW_AT_location` that covers `[prologue_end, epilogue_begin)`), but for which there is no existing LLVM component that tells us that.

Though, if using a python script is a major blocker there are a few alternatives I think: we could implement this statistic in llvm-dwarfdump (though I'm not sure whether that would be a justifiable change); we could make this a Dexter test in cross-project-tests (at the cost of involving extra components that aren't really related to the test); or we could extract this information some other way, e.g. using some series of `sed` commands.

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


More information about the llvm-commits mailing list