]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile: schedule SP earlier
authorKeith Randall <khr@golang.org>
Wed, 15 Feb 2023 01:25:48 +0000 (17:25 -0800)
committerKeith Randall <khr@google.com>
Wed, 15 Feb 2023 15:41:26 +0000 (15:41 +0000)
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>
src/cmd/compile/internal/ssa/debug_lines_test.go
src/cmd/compile/internal/ssa/schedule.go

index 268c4c41db6cd50fa8f15b4cd6eb88e9feb6f28a..cf115107a1c171c7d650c7772eb0ed066fd0a2c2 100644 (file)
@@ -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)
 }
 
index c291e5c13f0079955693f09a61594a8b0b86be30..679d1487d01cac5e85ee26db8ef0995b9d3fe38c 100644 (file)
@@ -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():