Commit d032927
committed
[DebugInfo][Mem2Reg] Assign uninitialized values with annotated locs
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.1 parent 3b19717 commit d032927
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
853 | | - | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
854 | 855 | | |
| 856 | + | |
| 857 | + | |
855 | 858 | | |
856 | 859 | | |
857 | 860 | | |
| |||
0 commit comments