]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove redundant function idom
authorHajime Hoshi <hajimehoshi@gmail.com>
Sat, 8 Oct 2016 16:09:52 +0000 (01:09 +0900)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 11 Oct 2016 16:43:12 +0000 (16:43 +0000)
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>
src/cmd/compile/internal/ssa/func.go
src/cmd/compile/internal/ssa/lca.go
src/cmd/compile/internal/ssa/prove.go
src/cmd/compile/internal/ssa/sparsetreemap.go
src/cmd/compile/internal/ssa/tighten.go

index 6ba54489988a6c96620d9a28af9b551c26135103..dbdc42d1f8925fdcac0e20a53899dc36d58cfee1 100644 (file)
@@ -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
 }
index ca9470302b5d91bf498d39dcc54c7b93bb69c920..b9731fa7c24ff24f4d57ae66d868af8cfb3621a7 100644 (file)
@@ -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())
index 659d38ede83df20c0b143e89218a9bd2dc01dbcc..2b6244c20958c5251c2546d6843fc4e46185a4cc 100644 (file)
@@ -463,7 +463,7 @@ func prove(f *Func) {
        })
 
        ft := newFactsTable()
-       idom := f.idom()
+       idom := f.Idom()
        sdom := f.sdom()
 
        // DFS on the dominator tree.
index b7624ada55c0c48db8dca99d3483d03d6c23a336..d26467517e193dfda3829ae33e54f2811f3bc4f0 100644 (file)
@@ -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)
index bed1704dc3eb6e5769b7d60797583042d006049f..6f192630551ac52970cc255ff359d9c05f185779 100644 (file)
@@ -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()