Skip to content

Commit 9dc351b

Browse files
committed
cmd/compile/internal/ssa: batch up all zero-width instructions
When generating location lists, batch up changes for all zero-width instructions, not just phis. This prevents the creation of location list entries that don't actually cover any instructions. This isn't perfect because of the caveats in the prior CL (Copy is zero-width sometimes) but in practice this seems to fix all of the empty lists in std. Change-Id: Ice4a9ade36b6b24ca111d1494c414eec96e5af25 Reviewed-on: https://go-review.googlesource.com/97958 Run-TryBot: Heschi Kreinick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent caa1b4a commit 9dc351b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cmd/compile/internal/ssa/debug.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,24 +790,24 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) {
790790

791791
state.mergePredecessors(b, blockLocs)
792792

793-
phisPending := false
793+
zeroWidthPending := false
794794
for _, v := range b.Values {
795795
slots := state.valueNames[v.ID]
796796
reg, _ := state.f.getHome(v.ID).(*Register)
797797
changed := state.processValue(v, slots, reg)
798798

799-
if v.Op == OpPhi {
799+
if opcodeTable[v.Op].zeroWidth {
800800
if changed {
801-
phisPending = true
801+
zeroWidthPending = true
802802
}
803803
continue
804804
}
805805

806-
if !changed && !phisPending {
806+
if !changed && !zeroWidthPending {
807807
continue
808808
}
809809

810-
phisPending = false
810+
zeroWidthPending = false
811811
for _, varID := range state.changedVars.contents() {
812812
state.updateVar(VarID(varID), v, state.currentState.slots)
813813
}

0 commit comments

Comments
 (0)