[PATCH] D30835: [DebugInfo][X86] Teach Optimize LEAs pass to handle debug values

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 09:22:10 PDT 2017


andrewng added a comment.

In https://reviews.llvm.org/D30835#699193, @andrewng wrote:

> In https://reviews.llvm.org/D30835#697996, @andrewng wrote:
>
> > In https://reviews.llvm.org/D30835#697933, @dblaikie wrote:
> >
> > > Looks like this change does two things - fixes the "debug info affects optimization" and also does some work to improve optimized debug info quality? Might be worth separating this into two changes to make sure there's good test coverage/easier to review/etc?
> >
> >
> > I'm about to leave work now but I will look on Monday into whether separating this into two makes sense.
>
>
> On further consideration, I think it makes sense to keep the patch as is because otherwise the first patch would be "lossy", i.e. the output would lose debug information. So in fixing the optimisation, ideally the debug information should be correct and preserved. However, if there are concerns with the "patching" of the debug information, then it might make sense to split the patch. What are your thoughts?


I have looked in more detail into the DWARF debug generated by this patch (a side-effect of looking at another debug related codegen issue) and it turns out that the DWARF expression created isn't valid. I have a potential solution in progress, but it looks though generating "correct" DWARF for this particular scenario isn't as straightforward as it first appeared!

So as originally suggested, I will split this patch into one that fixes the codegen but removes the debug values and then see if I can create a reasonable patch to preserve the debug values.


https://reviews.llvm.org/D30835





More information about the llvm-commits mailing list