Change-Id: I1738e3af7de0972c54d74325d80781059d0796d8
Reviewed-on: https://go-review.googlesource.com/19186
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
}
}
-// returns true if b dominates c.
-// simple and iterative, has O(depth) complexity in tall trees.
-func dom(b, c *Block, idom []*Block) bool {
- // Walk up from c in the dominator tree looking for b.
- for c != nil {
- if c == b {
- return true
- }
- c = idom[c.ID]
- }
- // Reached the entry block, never saw b.
- return false
-}
-
// An eqclass approximates an equivalence class. During the
// algorithm it may represent the union of several of the
// final equivalence classes.