Dropped debug locations in pass-remarks
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Sometimes when using pass-remarks we can see some locations dropped.
Like for example:
```
remark: :0:0: load eliminated by PRE
remark: :0:0: load eliminated by PRE
remark: :0:0: hoisting load
remark: :0:0: hoisting load
remark: :0:0: Stores SLP vectorized with cost -1 and with tree size 2
```
Yes, we do that intentionally trying to keep sane user experience when stepping in a debugger.
There are quite a few places across LLVM passes where that happens. There was an effort to make that more explicit
(see for example https://github.com/llvm/llvm-project/pull/136192) and I guess there might be more places where DL got dropped.
The core issue is having debug location serving dual purpose and better debugging experience just won in this conflict.
My question is can we introduce an option/flag to not drop debug location in these cases trying also to improve user experience with compiler optimization information?
Contributor guide
Research direction
Start by reviewing the pass-remarks output showing :0:0 locations and the LLVM passes where debug locations are intentionally dropped. Read the referenced pull request 136192 to understand the existing explicit handling. Done means the proposed option or flag has a defined scope and preserves the relevant locations without undermining debugger stepping behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100