While the quality of debug info at -O0 has reached a satisfactory level, debugging code that was optimized by LLVM still poses a challenge, primarily because variable locations may get dropped at any time in the compilation.
We will start by presenting statistics aimed at identifying the worst offenders among the compilation stages and highlight known problems including debug value location tracking in the backend, the register allocator, optimizing transformations, and shortcomings of LLVM IR, before opening the floor to a discussion on strategies for improving the quality of debug info for optimized code.