diff options
| author | Keith Randall <khr@golang.org> | 2023-02-15 16:11:37 -0800 |
|---|---|---|
| committer | Keith Randall <khr@google.com> | 2023-02-16 02:02:00 +0000 |
| commit | 518889b35cb07f3e71963f2ccfc0f96ee26a51ce (patch) | |
| tree | 7d6dd9f198de4dbe6ad7dee4db69b4b4de814095 /src | |
| parent | 55044288ad22f0c46ac55375ed9ef3de1babb77c (diff) | |
| download | go-518889b35cb07f3e71963f2ccfc0f96ee26a51ce.tar.xz | |
cmd/compile: ensure InitMem comes after Args
The debug info generation currently depends on this invariant.
A small update to CL 468455.
Update #58482
Change-Id: Ica305d360d9af04036c604b6a65b683f7cb6e212
Reviewed-on: https://go-review.googlesource.com/c/go/+/468695
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/ssa/schedule.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go index 679d1487d0..49bad25765 100644 --- a/src/cmd/compile/internal/ssa/schedule.go +++ b/src/cmd/compile/internal/ssa/schedule.go @@ -15,6 +15,7 @@ import ( const ( ScorePhi = iota // towards top of block ScoreArg // must occur at the top of the entry block + ScoreInitMem // after the args - used as mark by debug info generation ScoreReadTuple // must occur immediately after tuple-generating insn (or call) ScoreNilCheck ScoreMemory @@ -162,9 +163,12 @@ func schedule(f *Func) { f.Fatalf("%s appeared outside of entry block, b=%s", v.Op, b.String()) } score[v.ID] = ScorePhi - case v.Op == OpArg || v.Op == OpSP || v.Op == OpSB || v.Op == OpInitMem: + case v.Op == OpArg || v.Op == OpSP || v.Op == OpSB: // We want all the args as early as possible, for better debugging. score[v.ID] = ScoreArg + case v.Op == OpInitMem: + // Early, but after args. See debug.go:buildLocationLists + score[v.ID] = ScoreInitMem case v.Type.IsMemory(): // Schedule stores as early as possible. This tends to // reduce register pressure. |
