summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/lower.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2015-08-04 15:47:22 -0700
committerKeith Randall <khr@golang.org>2015-08-04 23:32:42 +0000
commitd1c15a0e3ed1ba9c846a35d637c92525f07258a8 (patch)
tree6aac952338aa9247bd32c90cb1c440d3732a980c /src/cmd/compile/internal/ssa/lower.go
parent9495e45c8077fe2f562a57da8e3593b1779b2d2f (diff)
downloadgo-git-d1c15a0e3ed1ba9c846a35d637c92525f07258a8.tar.gz
[dev.ssa] cmd/compile/internal/ssa: implement ITAB
Implement ITAB, selecting the itable field of an interface. Soften the lowering check to allow lowerings that leave generic but dead ops behind. (The ITAB lowering does this.) Change-Id: Icc84961dd4060d143602f001311aa1d8be0d7fc0 Reviewed-on: https://go-review.googlesource.com/13144 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/lower.go')
-rw-r--r--src/cmd/compile/internal/ssa/lower.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/lower.go b/src/cmd/compile/internal/ssa/lower.go
index 6499dc8565..6f6b885062 100644
--- a/src/cmd/compile/internal/ssa/lower.go
+++ b/src/cmd/compile/internal/ssa/lower.go
@@ -8,8 +8,13 @@ package ssa
func lower(f *Func) {
// repeat rewrites until we find no more rewrites
applyRewrite(f, f.Config.lowerBlock, f.Config.lowerValue)
+}
- // Check for unlowered opcodes, fail if we find one.
+// checkLower checks for unlowered opcodes and fails if we find one.
+func checkLower(f *Func) {
+ // Needs to be a separate phase because it must run after both
+ // lowering and a subsequent dead code elimination (because lowering
+ // rules may leave dead generic ops behind).
for _, b := range f.Blocks {
for _, v := range b.Values {
if opcodeTable[v.Op].generic && v.Op != OpSP && v.Op != OpSB && v.Op != OpArg && v.Op != OpCopy && v.Op != OpPhi {