aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-02-14 17:25:48 -0800
committerKeith Randall <khr@google.com>2023-02-15 15:41:26 +0000
commit40ed3591829f67e7a116180aec543dd15bfcf5f9 (patch)
tree56fb7a8813c07f2435fd0aae70537b0b0bfd777f /src
parent30151f2aac2882dcb369019acfec95d16fea3c02 (diff)
downloadgo-40ed3591829f67e7a116180aec543dd15bfcf5f9.tar.xz
cmd/compile: schedule SP earlier
The actual scheduling of SP early doesn't really matter, but lots of early spills (of arguments) depend on SP so they can't schedule until SP does. Fixes #58482 Change-Id: Ie581fba7cb173d665c11f797f39d824b1c040a2d Reviewed-on: https://go-review.googlesource.com/c/go/+/468455 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/ssa/debug_lines_test.go2
-rw-r--r--src/cmd/compile/internal/ssa/schedule.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/debug_lines_test.go b/src/cmd/compile/internal/ssa/debug_lines_test.go
index 268c4c41db..cf115107a1 100644
--- a/src/cmd/compile/internal/ssa/debug_lines_test.go
+++ b/src/cmd/compile/internal/ssa/debug_lines_test.go
@@ -114,7 +114,7 @@ func TestInlineLines(t *testing.T) {
t.Skip("only runs for amd64 unless -arch explicitly supplied")
}
- want := [][]int{{3}, {3}, {4, 10}, {4, 10, 16}, {4, 10}, {4, 11, 16}, {4, 11}, {4}, {5, 10}, {5, 10, 16}, {5, 10}, {5, 11, 16}, {5, 11}, {5}}
+ want := [][]int{{3}, {4, 10}, {4, 10, 16}, {4, 10}, {4, 11, 16}, {4, 11}, {4}, {5, 10}, {5, 10, 16}, {5, 10}, {5, 11, 16}, {5, 11}, {5}}
testInlineStack(t, "inline-dump.go", "f", want)
}
diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go
index c291e5c13f..679d1487d0 100644
--- a/src/cmd/compile/internal/ssa/schedule.go
+++ b/src/cmd/compile/internal/ssa/schedule.go
@@ -162,7 +162,7 @@ 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:
+ case v.Op == OpArg || v.Op == OpSP || v.Op == OpSB || v.Op == OpInitMem:
// We want all the args as early as possible, for better debugging.
score[v.ID] = ScoreArg
case v.Type.IsMemory():