[PATCH] D29254: Do not propagate DebugLoc across basic blocks

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 12:38:05 PST 2017

andreadb accepted this revision.
andreadb added a comment.
This revision is now accepted and ready to land.

This patch looks good to me.

We shouldn't propagate the debugloc from the load to the newly created phi node. Otherwise, we risk to introduce an incorrect stepping. When leaving the SSA form, all the phi nodes are replaced by COPY instructions. Luckily, most copies become redundant after regalloc; however, some copies may survive register allocation.
In the example, if the COPY obtained from `%0 = phi i32 [ %1, %for.inc ], [ %.sink, %for.body.preheader ], !dbg !21` survives regalloc, then we would have an incorrect stepping.

Thanks for fixing it.


More information about the llvm-commits mailing list