[llvm] [SROA] Fix incorrect offsets for structured binding variables (PR #69007)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 03:49:00 PDT 2023


OCHyams wrote:

Thanks for the reviews.

While reviewing #69681 I noticed the original structured bindings test X includes a trivial example where DW_OP_deref is added to an expression in this scenario. Having the binding variables be references is enough: https://godbolt.org/z/E9EGnbEde

That makes me less comfortable with this fix. I'll convert this PR to a draft for now; I think we should move forward with one of the options I mentioned in the summary (copied below). I won't be able to take a look at this immediately but will hopefully get back to it within a week or two.

> If this is not an acceptable trade off, I suggest we simply undef/kill split alloca dbg.declares with offsets until a more complete solution can be cooked up. That would probably involve interpreting the DIExpression and splicing the non-offset non-fragment part into the new expression. I'm not sure how difficult this is (it could be simple, but will probably be a little fiddly).

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


More information about the llvm-commits mailing list