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: David Chase <drchase@google.com>
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
}
}