mirror of
https://github.com/golang/go
synced 2024-11-18 14:54:40 -07:00
cmd/compile: remove redundant function idom
Change-Id: Ib14b5421bb5e407bbd4d3cbfc68c92d3dd257cb1 Reviewed-on: https://go-review.googlesource.com/30732 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
f1eed92fd0
commit
c5368123fe
@ -451,23 +451,20 @@ func (f *Func) postorder() []*Block {
|
||||
return f.cachedPostorder
|
||||
}
|
||||
|
||||
// idom returns a map from block ID to the immediate dominator of that block.
|
||||
// Idom returns a map from block ID to the immediate dominator of that block.
|
||||
// f.Entry.ID maps to nil. Unreachable blocks map to nil as well.
|
||||
func (f *Func) idom() []*Block {
|
||||
func (f *Func) Idom() []*Block {
|
||||
if f.cachedIdom == nil {
|
||||
f.cachedIdom = dominators(f)
|
||||
}
|
||||
return f.cachedIdom
|
||||
}
|
||||
func (f *Func) Idom() []*Block {
|
||||
return f.idom()
|
||||
}
|
||||
|
||||
// sdom returns a sparse tree representing the dominator relationships
|
||||
// among the blocks of f.
|
||||
func (f *Func) sdom() SparseTree {
|
||||
if f.cachedSdom == nil {
|
||||
f.cachedSdom = newSparseTree(f, f.idom())
|
||||
f.cachedSdom = newSparseTree(f, f.Idom())
|
||||
}
|
||||
return f.cachedSdom
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ type lcaRangeBlock struct {
|
||||
}
|
||||
|
||||
func makeLCArange(f *Func) *lcaRange {
|
||||
dom := f.idom()
|
||||
dom := f.Idom()
|
||||
|
||||
// Build tree
|
||||
blocks := make([]lcaRangeBlock, f.NumBlocks())
|
||||
|
@ -463,7 +463,7 @@ func prove(f *Func) {
|
||||
})
|
||||
|
||||
ft := newFactsTable()
|
||||
idom := f.idom()
|
||||
idom := f.Idom()
|
||||
sdom := f.sdom()
|
||||
|
||||
// DFS on the dominator tree.
|
||||
|
@ -57,7 +57,7 @@ type SparseTreeHelper struct {
|
||||
// NewSparseTreeHelper returns a SparseTreeHelper for use
|
||||
// in the gc package, for example in phi-function placement.
|
||||
func NewSparseTreeHelper(f *Func) *SparseTreeHelper {
|
||||
dom := f.idom()
|
||||
dom := f.Idom()
|
||||
ponums := make([]int32, f.NumBlocks())
|
||||
po := postorderWithNumbering(f, ponums)
|
||||
return makeSparseTreeHelper(newSparseTree(f, dom), dom, po, ponums)
|
||||
|
@ -56,7 +56,7 @@ func tighten(f *Func) {
|
||||
|
||||
// Grab loop information.
|
||||
// We use this to make sure we don't tighten a value into a (deeper) loop.
|
||||
idom := f.idom()
|
||||
idom := f.Idom()
|
||||
loops := f.loopnest()
|
||||
loops.calculateDepths()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user