[llvm] [DWARF] Emit a worst-case prologue_end flag for pathological inputs (PR #107849)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 03:55:53 PST 2024


jmorse wrote:

(Hoisting to here as github has lost the inner comments),

The interaction with linezero prologue_ends is interesting -- I don't think there's anything useful that comes from putting prologue_end on line zero as it doesn't communicate anything further about the function: the frame is setup, but there's no particular line you've stopped at. I think the code selecting for it was part of the previous strategy of "Hang prologue_end onto another line-table entry".

With the revision I've removed the prioritisation of line-zero locations over the "first meaningful instruction" location, which independently makes sense IMO. I've also added a filter to not set prologue_end on the first meaningful instruction if it's also line-zero: it won't communicate anything useful, and giving it a real line-number would be misleading. The outcome is then no prologue_end flag being set, which is the most accurate outcome IMO in these situations.

In terms of test coverage this means `CodeGen/X86/no-non-zero-debug-loc-prologue.ll` no longer generates a prologue, which I've added an implicit-check-not to test for.

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


More information about the llvm-commits mailing list