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>
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))
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 {