[llvm] [ExtendLifetimes] Implement llvm.fake.use to extend variable lifetimes (PR #86149)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 21 10:32:22 PDT 2024
SLTozer wrote:
> So, depending on how/when these intrinsics are generated, this patch could affect a few different targets.
Interesting; I think falling back on SelectionDAG would produce a relatively normal result (emitting `FAKE_USE`), but hard to say whether there would be any knock-on effects. In the worst case scenario we could just drop fake uses in GlobalISel - it should be safe to do so, since the intrinsics themselves are no-ops, it just means that the values will no longer be protected from the start of ISel onwards.
> And it would introduce a situation we usually try to avoid: the presence of debug info could significantly change code generation.
This intrinsic has no technical relation to debug info; the purpose is to improve debug info quality when enabled, but the codegen effects of this flag are unrelated to whether debug info is emitted or not; if you use `-fextend-lifetimes` without `-g`, you'll prevent optimizations that would have harmed debug info even when that debug info isn't present.
https://github.com/llvm/llvm-project/pull/86149
More information about the llvm-commits
mailing list