Stephen Kell and I have been working on a new approach to test debug info of optimised programs which we believe will help with identifying debug info handling bugs in LLVM optimisation passes. We plan to share more details of our approach in the near future, and we will publish the tools we have developed for everyone in the community to use.
We have filed several issues that we found using our technique so far:
- Reassociate drops debug value info for decremented variable
- IndVarSimplify loses track of debug value from loop body
- InstCombine drops debug value info towards end of function
- EarlyCSE drops debug info for pointer values derived from arguments
- InstCombine drops debug value info for start of live range
- InstCombine drops debug value after simplifying to boolean
- Reassociate stops tracking debug value after several steps
It would be great to get some initial feedback from the LLVM debug info community on these issues. For example…
- Do they seem like valid issues? If they do, a comment on each issue will help us keep track of which are confirmed to be valid. If they do not, let’s discuss this either on each problematic issue or over here so we can improve future reports.
- Do they appear to contain enough detail to investigate further? If they do not, what additional info would you like to see?
Feel free to provide feedback in whatever way is easiest for you.
Assuming there’s general agreement that these issues are valid and useful, we’ll continue to report more as we discover them. We’re also planning to pursue fixes for these issues together with the community.
We hope to do much more than just file and fix bugs. If you have any ideas for tooling that would help with triaging and fixing these kinds of issues, please do let us know. For example, we’ve considered building debug-info-focused tools such as enhanced pass bisection to find the one responsible for a failure, and also enhanced version bisection to spot when a issue first appeared.
Beyond tooling, we also intend to explore various architectural changes to LLVM debug info handling that will hopefully make these kinds of failures much less likely. We will share more info on these ideas at a later date. Any changes we’re attempting to merge upstream would start first with an RFC thread to ensure the approach is agreeable to the community.
Thanks for your time and effort towards more reliable debugging with LLVM-based tools.