]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/internal/ssa: add more critical edges
authorKeith Randall <khr@golang.org>
Tue, 25 Aug 2015 21:02:30 +0000 (14:02 -0700)
committerKeith Randall <khr@golang.org>
Tue, 25 Aug 2015 21:20:18 +0000 (21:20 +0000)
Add blocks to remove critical edges, even when it looks like
there's no phi that requires it.  Regalloc still likes to have
critical-edge-free graphs for other reasons.

Change-Id: I69f8eaecbc5d79ab9f2a257c2e289d60b18e43c8
Reviewed-on: https://go-review.googlesource.com/13933
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/check.go
src/cmd/compile/internal/ssa/critical.go

index 263140113050dfb9c0a3edf3111103e119abf63b..61626089a6015b42b4c56898e0f7ae43befbbca9 100644 (file)
@@ -99,9 +99,6 @@ func checkFunc(f *Func) {
                        if !b.Control.Type.IsMemory() {
                                f.Fatalf("call block %s has non-memory control value %s", b, b.Control.LongString())
                        }
-                       if b.Succs[1].Kind != BlockExit {
-                               f.Fatalf("exception edge from call block %s does not go to exit but %s", b, b.Succs[1])
-                       }
                }
                if len(b.Succs) > 2 && b.Likely != BranchUnknown {
                        f.Fatalf("likeliness prediction %d for block %s with %d successors: %s", b.Likely, b, len(b.Succs))
index 503681ffd3b14b53367d18cb0e88f38b6fbce4da..ba754508759a5df6512ad22d76eb2c53cf3d32c5 100644 (file)
@@ -13,19 +13,6 @@ func critical(f *Func) {
                        continue
                }
 
-               // decide if we need to split edges coming into b.
-               hasphi := false
-               for _, v := range b.Values {
-                       if v.Op == OpPhi && v.Type != TypeMem {
-                               hasphi = true
-                               break
-                       }
-               }
-               if !hasphi {
-                       // no splitting needed
-                       continue
-               }
-
                // split input edges coming from multi-output blocks.
                for i, c := range b.Preds {
                        if c.Kind == BlockPlain {