[llvm-branch-commits] [llvm] Propagate DebugLocs on phis in BreakCriticalEdges (PR #133492)

Orlando Cazalet-Hyams via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 23 10:48:38 PDT 2025


OCHyams wrote:

> Seems fine; although why's it needed for key instructions, I have a vague recollection that LLVM doesn't actually care about the source locations attached to PHIs?

The motivation came from reviewing code duplication sites to update for Key Instructions, finding this, trying to generate a test case and seeing the DebugLocs aren't propagated. That is it say it's not massively principled, and I can't remember off-hand whether this affected any of the "real code" I tested the feature on (I have a feeling the answer is no).

I'm also not 100% sure if there's a good "policy" in place for PHI debug locs (paging @SLTozer) - I made this change erring on the side of correct-but-maybe-unnecessary. If we know it's unnecessary, we can ditch this patch and the next.

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


More information about the llvm-branch-commits mailing list