Commit 6ed79fbd authored by Keith Randall's avatar Keith Randall

cmd/compile: remove BlockDead state

It is unused, remove the clutter.

Change-Id: I51a44326b125ef79241459c463441f76a289cc08
Reviewed-on: https://go-review.googlesource.com/22586Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 3cb090f9
...@@ -85,19 +85,6 @@ func checkFunc(f *Func) { ...@@ -85,19 +85,6 @@ func checkFunc(f *Func) {
if b.Aux == nil { if b.Aux == nil {
f.Fatalf("retjmp block %s has nil Aux field", b) f.Fatalf("retjmp block %s has nil Aux field", b)
} }
case BlockDead:
if len(b.Succs) != 0 {
f.Fatalf("dead block %s has successors", b)
}
if len(b.Preds) != 0 {
f.Fatalf("dead block %s has predecessors", b)
}
if len(b.Values) != 0 {
f.Fatalf("dead block %s has values", b)
}
if b.Control != nil {
f.Fatalf("dead block %s has a control value", b)
}
case BlockPlain: case BlockPlain:
if len(b.Succs) != 1 { if len(b.Succs) != 1 {
f.Fatalf("plain block %s len(Succs)==%d, want 1", b, len(b.Succs)) f.Fatalf("plain block %s len(Succs)==%d, want 1", b, len(b.Succs))
......
...@@ -438,9 +438,8 @@ var genericBlocks = []blockData{ ...@@ -438,9 +438,8 @@ var genericBlocks = []blockData{
{name: "RetJmp"}, // no successors, jumps to b.Aux.(*gc.Sym) {name: "RetJmp"}, // no successors, jumps to b.Aux.(*gc.Sym)
{name: "Exit"}, // no successors, control value generates a panic {name: "Exit"}, // no successors, control value generates a panic
// transient block states used for dead code removal // transient block state used for dead code removal
{name: "First"}, // 2 successors, always takes the first one (second is dead) {name: "First"}, // 2 successors, always takes the first one (second is dead)
{name: "Dead"}, // no successors; determined to be dead but not yet removed
} }
func init() { func init() {
......
...@@ -47,7 +47,6 @@ const ( ...@@ -47,7 +47,6 @@ const (
BlockRetJmp BlockRetJmp
BlockExit BlockExit
BlockFirst BlockFirst
BlockDead
) )
var blockString = [...]string{ var blockString = [...]string{
...@@ -88,7 +87,6 @@ var blockString = [...]string{ ...@@ -88,7 +87,6 @@ var blockString = [...]string{
BlockRetJmp: "RetJmp", BlockRetJmp: "RetJmp",
BlockExit: "Exit", BlockExit: "Exit",
BlockFirst: "First", BlockFirst: "First",
BlockDead: "Dead",
} }
func (k BlockKind) String() string { return blockString[k] } func (k BlockKind) String() string { return blockString[k] }
......
...@@ -26,9 +26,6 @@ func applyRewrite(f *Func, rb func(*Block) bool, rv func(*Value, *Config) bool) ...@@ -26,9 +26,6 @@ func applyRewrite(f *Func, rb func(*Block) bool, rv func(*Value, *Config) bool)
for { for {
change := false change := false
for _, b := range f.Blocks { for _, b := range f.Blocks {
if b.Kind == BlockDead {
continue
}
if b.Control != nil && b.Control.Op == OpCopy { if b.Control != nil && b.Control.Op == OpCopy {
for b.Control.Op == OpCopy { for b.Control.Op == OpCopy {
b.SetControl(b.Control.Args[0]) b.SetControl(b.Control.Args[0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment