aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/schedule.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2015-08-05 16:07:13 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2015-08-06 17:26:34 +0000
commitf1401f1a1084327c4f24a4403dbc7003867ee009 (patch)
treeb5c60ce04fd3d139a74ea9c7e2c6a0e4fa3d620f /src/cmd/compile/internal/ssa/schedule.go
parentcd0cb0a9d6e7c5594e2870239290ff5704de0ef3 (diff)
downloadgo-f1401f1a1084327c4f24a4403dbc7003867ee009.tar.gz
go-f1401f1a1084327c4f24a4403dbc7003867ee009.zip
[dev.ssa] cmd/compile: schedule phi control values first
Change-Id: I684440dc316625d5572cc12179adbc206e306429 Reviewed-on: https://go-review.googlesource.com/13263 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/schedule.go')
-rw-r--r--src/cmd/compile/internal/ssa/schedule.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go
index d1596f25e8..9c8e9a1156 100644
--- a/src/cmd/compile/internal/ssa/schedule.go
+++ b/src/cmd/compile/internal/ssa/schedule.go
@@ -15,7 +15,7 @@ func schedule(f *Func) {
uses := make([]int, f.NumValues())
// "priority" for a value
- score := make([]int, f.NumValues())
+ score := make([]uint8, f.NumValues())
// scheduling order. We queue values in this list in reverse order.
var order []*Value
@@ -57,8 +57,9 @@ func schedule(f *Func) {
score[v.ID] = 1
}
}
- if b.Control != nil {
- // Force the control value to be scheduled at the end.
+ if b.Control != nil && b.Control.Op != OpPhi {
+ // Force the control value to be scheduled at the end,
+ // unless it is a phi value (which must be first).
score[b.Control.ID] = 3
// TODO: some times control values are used by other values
// in the block. So the control value will not appear at