The branch itself can't be marked, so we ensure we mark the last
ssa.Value in the block as uninterruptible, because that's where the
branch ends up getting its uninterruptibility from.
This is somewhat conservative, as we're marking an instruction as
uninterruptible that doesn't need to be. But it is an easy fix.
TODO: figure out a test
Change-Id: Icd314f0bbdce8f80019bafb9e861baca4e7ecbb1
Reviewed-on: https://go-review.googlesource.com/c/go/+/518055
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
// Mark everything after the load unsafe.
found := false
- for _, v := range decisionBlock.Values {
- if found {
+ for i, v := range decisionBlock.Values {
+ if found || i == len(decisionBlock.Values)-1 {
+ // Note: we need at least one instruction marked so that
+ // the branch instruction at the end of the block also
+ // gets marked.
lv.unsafePoints.Set(int32(v.ID))
}
found = found || v == load