diff options
author | Keith Randall <khr@google.com> | 2018-01-22 09:43:27 -0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2018-02-20 00:56:13 +0000 |
commit | 4313d7767d830e863e8f8b53a2b48ca8d0bf0a79 (patch) | |
tree | 3ae0c9a4810318fe07e0bfa7e56efceb1afc3b90 /src/cmd/compile/internal/ssa/check.go | |
parent | 252ee90971d87f099a2e67c3536a0481a535157f (diff) | |
download | go-4313d7767d830e863e8f8b53a2b48ca8d0bf0a79.tar.gz go-4313d7767d830e863e8f8b53a2b48ca8d0bf0a79.zip |
cmd/compile: reset branch prediction when deleting a branch
When we go from a branch block to a plain block, reset the
branch prediction bit. Downstream passes asssume that if the
branch prediction is set, then the block has 2 successors.
Fixes #23504
Change-Id: I2898ec002228b2e34fe80ce420c6939201c0a5aa
Reviewed-on: https://go-review.googlesource.com/88955
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/check.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/check.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/check.go b/src/cmd/compile/internal/ssa/check.go index de77aff480..721e451f05 100644 --- a/src/cmd/compile/internal/ssa/check.go +++ b/src/cmd/compile/internal/ssa/check.go @@ -102,7 +102,7 @@ func checkFunc(f *Func) { f.Fatalf("plain/dead block %s has a control value", b) } } - if len(b.Succs) > 2 && b.Likely != BranchUnknown { + if len(b.Succs) != 2 && b.Likely != BranchUnknown { f.Fatalf("likeliness prediction %d for block %s with %d successors", b.Likely, b, len(b.Succs)) } |