llvm-project
ead0e976 - [DebugInfo][Mem2Reg] Assign uninitialized values with annotated locs (#157716)

Commit
9 days ago
[DebugInfo][Mem2Reg] Assign uninitialized values with annotated locs (#157716) In PromoteMem2Reg, we perform a DFS over the CFG and track, for each alloca, its incoming value and its associated incoming DebugLoc, both of which are taken from stores to that alloca; these values and DebugLocs are propagated to PHI nodes when new blocks are reached. In the event that for one incoming edge no store instruction has been seen, we propagate an UndefValue and an empty DebugLoc to the PHI. This is a perfectly valid occurrence, and assigning an empty DebugLoc to the PHI is the correct course of action; therefore, we should pass an annotated DebugLoc instead, so that in DebugLoc coverage tracking we correctly do not expect a valid DebugLoc to be present; we generally mark allocas as having CompilerGenerated locations, so I've chosen to use the same annotation to represent the uninitialized value of that alloca. This change is NFC outside of DebugLoc coverage tracking builds.
Author
Parents
Loading