aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/layout.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-04-21 10:55:42 -0400
committerDavid Chase <drchase@google.com>2021-05-08 17:03:18 +0000
commitb38b1b2f9ae710ee2c16a103bb21644f1adbc5d3 (patch)
tree49395dd78b327b3f7e4d22d3c0229763de12ca39 /src/cmd/compile/internal/ssa/layout.go
parent68327e1aa11457cd570bc7eaf03a0260950f27d9 (diff)
downloadgo-b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3.tar.gz
go-b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3.zip
cmd/compile: manage Slot array better
steals idea from CL 312093 further investigation revealed additional duplicate slots (equivalent, but not equal), so delete those too. Rearranged Func.Names to be addresses of slots, create canonical addresses so that split slots (which use those addresses to refer to their parent, and split slots can be further split) will preserve "equivalent slots are equal". Removes duplicates, improves metrics for "args at entry". Change-Id: I5bbdcb50bd33655abcab3d27ad8cdce25499faaf Reviewed-on: https://go-review.googlesource.com/c/go/+/312292 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/layout.go')
-rw-r--r--src/cmd/compile/internal/ssa/layout.go22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/cmd/compile/internal/ssa/layout.go b/src/cmd/compile/internal/ssa/layout.go
index a7fd73aead..6abdb0d0c9 100644
--- a/src/cmd/compile/internal/ssa/layout.go
+++ b/src/cmd/compile/internal/ssa/layout.go
@@ -12,26 +12,10 @@ func layout(f *Func) {
}
// Register allocation may use a different order which has constraints
-// imposed by the linear-scan algorithm. Note that f.pass here is
-// regalloc, so the switch is conditional on -d=ssa/regalloc/test=N
+// imposed by the linear-scan algorithm.
func layoutRegallocOrder(f *Func) []*Block {
-
- switch f.pass.test {
- case 0: // layout order
- return layoutOrder(f)
- case 1: // existing block order
- return f.Blocks
- case 2: // reverse of postorder; legal, but usually not good.
- po := f.postorder()
- visitOrder := make([]*Block, len(po))
- for i, b := range po {
- j := len(po) - i - 1
- visitOrder[j] = b
- }
- return visitOrder
- }
-
- return nil
+ // remnant of an experiment; perhaps there will be another.
+ return layoutOrder(f)
}
func layoutOrder(f *Func) []*Block {