Commit 63ef3cde authored by Than McIntosh's avatar Than McIntosh

cmd/compile: ignore RegKill ops for non-phi after phi check

Relax the 'phi after non-phi' SSA sanity check to allow
RegKill ops interspersed with phi ops in a block. This fixes
a sanity check failure when -dwarflocationlists is enabled.

Updates #22694.

Change-Id: Iaae604ab6f1a8b150664dd120003727a6fb2f698
Reviewed-on: https://go-review.googlesource.com/77610
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarDavid Chase <drchase@google.com>
parent 4fbf54fa
......@@ -456,11 +456,16 @@ func memCheck(f *Func) {
for _, b := range f.Blocks {
seenNonPhi := false
for _, v := range b.Values {
if v.Op == OpPhi {
switch v.Op {
case OpPhi:
if seenNonPhi {
f.Fatalf("phi after non-phi @ %s: %s", b, v)
}
} else {
case OpRegKill:
if f.RegAlloc == nil {
f.Fatalf("RegKill seen before register allocation @ %s: %s", b, v)
}
default:
seenNonPhi = true
}
}
......
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