From: Keith Randall Date: Fri, 20 Jan 2023 18:36:19 +0000 (-0800) Subject: cmd/compile: ensure register args come before on-stack args in schedule X-Git-Tag: go1.21rc1~1849 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b08d5ee5e9c700a1267f0b883702766a19d89b2d;p=gostls13.git cmd/compile: ensure register args come before on-stack args in schedule The register allocator doesn't like OpArg coming in between other OpIntArg operations, as it doesn't put the spills in the right place in that situation. This is just a bug in the new scheduler, I didn't copy over the proper score from the old scheduler correctly. Change-Id: I3b4ee1754982fb360e99c5864b19e7408d60b5bc Reviewed-on: https://go-review.googlesource.com/c/go/+/462858 Run-TryBot: Keith Randall Reviewed-by: Cherry Mui Reviewed-by: Keith Randall Auto-Submit: Keith Randall TryBot-Result: Gopher Robot --- diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go index a69e406df2..246376c767 100644 --- a/src/cmd/compile/internal/ssa/schedule.go +++ b/src/cmd/compile/internal/ssa/schedule.go @@ -135,7 +135,7 @@ func schedule(f *Func) { if b != f.Entry { f.Fatalf("%s appeared outside of entry block, b=%s", v.Op, b.String()) } - score[v.ID] = ScoreArg + score[v.ID] = ScorePhi case v.Op == OpArg: // We want all the args as early as possible, for better debugging. score[v.ID] = ScoreArg