}
for _, b := range f.Blocks {
+ if b.Kind == BlockInvalid {
+ continue
+ }
for _, v := range b.Values {
if v.Op == OpIsInBounds || v.Op == OpIsSliceInBounds {
if f.pass.debug > 0 {
{name: "dead auto elim", fn: elimDeadAutosGeneric},
{name: "sccp", fn: sccp},
{name: "generic deadcode", fn: deadcode, required: true}, // remove dead stores, which otherwise mess up store chain
- {name: "check bce", fn: checkbce},
{name: "branchelim", fn: branchelim},
{name: "late fuse", fn: fuseLate},
+ {name: "check bce", fn: checkbce},
{name: "dse", fn: dse},
{name: "memcombine", fn: memcombine},
{name: "writebarrier", fn: writebarrier, required: true}, // expand write barrier ops
--- /dev/null
+// errorcheck -0 -d=ssa/check_bce/debug=1
+
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package x
+
+func Found(x []string) string {
+ switch len(x) {
+ default:
+ return x[0]
+ case 0, 1:
+ return ""
+ }
+}
+
+func NotFound(x []string) string {
+ switch len(x) {
+ default:
+ return x[0]
+ case 0:
+ return ""
+ case 1:
+ return ""
+ }
+}