mirror of
https://github.com/golang/go
synced 2024-11-26 02:47:58 -07:00
cmd/compile: get rid of special case in scheduler for entry block
It isn't needed. Fixes #61356 Change-Id: Ib466a3eac90c3ea57888cf40c294513033fc6118 Reviewed-on: https://go-review.googlesource.com/c/go/+/509856 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Keith Randall <khr@golang.org>
This commit is contained in:
parent
c94f39a80e
commit
505e50b1e3
@ -7,7 +7,6 @@ package ssa
|
|||||||
import (
|
import (
|
||||||
"cmd/compile/internal/base"
|
"cmd/compile/internal/base"
|
||||||
"cmd/compile/internal/types"
|
"cmd/compile/internal/types"
|
||||||
"cmd/internal/src"
|
|
||||||
"container/heap"
|
"container/heap"
|
||||||
"sort"
|
"sort"
|
||||||
)
|
)
|
||||||
@ -65,10 +64,6 @@ func (h ValHeap) Less(i, j int) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if x.Pos != y.Pos { // Favor in-order line stepping
|
if x.Pos != y.Pos { // Favor in-order line stepping
|
||||||
if x.Block == x.Block.Func.Entry && x.Pos.IsStmt() != y.Pos.IsStmt() {
|
|
||||||
// In the entry block, put statement-marked instructions earlier.
|
|
||||||
return x.Pos.IsStmt() == src.PosIsStmt && y.Pos.IsStmt() != src.PosIsStmt
|
|
||||||
}
|
|
||||||
return x.Pos.Before(y.Pos)
|
return x.Pos.Before(y.Pos)
|
||||||
}
|
}
|
||||||
if x.Op != OpPhi {
|
if x.Op != OpPhi {
|
||||||
|
55
test/codegen/issue61356.go
Normal file
55
test/codegen/issue61356.go
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// asmcheck
|
||||||
|
|
||||||
|
// Copyright 2023 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Make sure this code doesn't generate spill/restore.
|
||||||
|
|
||||||
|
package codegen
|
||||||
|
|
||||||
|
func pack20(in *[20]uint64) uint64 {
|
||||||
|
var out uint64
|
||||||
|
out |= 4
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[0] << 4
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[1] << 7
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[2] << 10
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[3] << 13
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[4] << 16
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[5] << 19
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[6] << 22
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[7] << 25
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[8] << 28
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[9] << 31
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[10] << 34
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[11] << 37
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[12] << 40
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[13] << 43
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[14] << 46
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[15] << 49
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[16] << 52
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[17] << 55
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[18] << 58
|
||||||
|
// amd64:-`.*SP.*`
|
||||||
|
out |= in[19] << 61
|
||||||
|
return out
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user