[llvm] [DebugInfo] Fix incorrect debug attribution for inlined allocas (PR #144345)

Shivam Kunwar via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 11:52:34 PDT 2025


phyBrackets wrote:

Thanks @SLTozer @dwblaikie for the inputs and review.

I agree that unconditionally clearing all alloca debug locations is too broad, I am not sure if we should handle directly it into stack protection pass by not inheriting debug locations from allocas , at this moment either the conditional approach sounds good, Clear debug locations only when there are conditional branches between the entry block and the call site, as you suggested. This preserves legitimate source locations (like` __builtin_alloca`) while fixing the attribution issue, but again traversing CFG comes with a cost, so definitely not an easy option, Or we should move with the current approach? 

I will take a look at it, until any other opinions and suggestions are welcome. 


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


More information about the llvm-commits mailing list