1
0
mirror of https://github.com/golang/go synced 2024-11-19 03:04:42 -07:00

cmd/compile: ignore dead phis in fuse

Happens occasionally for boolean phis was used as a control.

Change-Id: Ie0f2483e9004c1706751d8dfb25ee2e5106d917e
Reviewed-on: https://go-review.googlesource.com/21310
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Alexandru Moșoi 2016-03-30 16:19:10 +02:00 committed by Alexandru Moșoi
parent 152a08c531
commit d7f7ea6ea8

View File

@ -65,7 +65,7 @@ func fuseBlockIf(b *Block) bool {
b.Fatalf("invalid predecessors") b.Fatalf("invalid predecessors")
} }
for _, v := range ss.Values { for _, v := range ss.Values {
if v.Op == OpPhi && v.Args[i0] != v.Args[i1] { if v.Op == OpPhi && v.Uses > 0 && v.Args[i0] != v.Args[i1] {
return false return false
} }
} }