mirror of
https://github.com/golang/go
synced 2024-10-05 16:41:21 -06:00
[dev.ssa] cmd/compile/internal/ssa: add more critical edges
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>
This commit is contained in:
parent
ec39d78ddd
commit
a2f8b0d0e4
@ -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))
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user