aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/flagalloc.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2016-01-26 15:47:08 -0800
committerKeith Randall <khr@golang.org>2016-01-29 20:22:09 +0000
commitf94e0745b3dc922ca7f3d15507e33ed6d3a65ee6 (patch)
treea63610f5b047079a2502739c26a00716c321fc18 /src/cmd/compile/internal/ssa/flagalloc.go
parent5ba31940dc2934dc76a47f0e614d441225ea3a95 (diff)
downloadgo-f94e0745b3dc922ca7f3d15507e33ed6d3a65ee6.tar.gz
go-f94e0745b3dc922ca7f3d15507e33ed6d3a65ee6.zip
[dev.ssa] cmd/compile: prepare for some load+op combining
Rename StoreConst to ValAndOff so we can use it for other ops. Make ValAndOff print nicely. Add some notes & checks related to my aborted attempt to implement combined CMP+load ops. Change-Id: I2f901d12d42bc5a82879af0334806aa184a97e27 Reviewed-on: https://go-review.googlesource.com/18947 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/flagalloc.go')
-rw-r--r--src/cmd/compile/internal/ssa/flagalloc.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/flagalloc.go b/src/cmd/compile/internal/ssa/flagalloc.go
index f4e289e782..85e9c4fbee 100644
--- a/src/cmd/compile/internal/ssa/flagalloc.go
+++ b/src/cmd/compile/internal/ssa/flagalloc.go
@@ -42,11 +42,14 @@ func flagalloc(f *Func) {
}
}
}
- for _, p := range b.Preds {
- end[p.ID] = flag
+ if flag != nil {
+ for _, p := range b.Preds {
+ end[p.ID] = flag
+ }
}
}
}
+
// For blocks which have a flags control value, that's the only value
// we can leave in the flags register at the end of the block. (There
// is no place to put a flag regeneration instruction.)