With SIMD it is normal to iterate a slice let's say 8 elements at a time. Sadly this incurs a bound check:

    const step = 8
    for i := 0; i <= len(x)-step; i += step {
        _ = x[i : i+step] // Unnecessary bound check here :'(
    }

Comment From: TapirLiu

also for

    for i := 0; i <= len(x)-step; i += step {
        _ = x[i+step-1] // Unnecessary bound check here :'(
    }

see https://github.com/golang/go/issues/40987

Comment From: jvoisin

Another example, used in bcrypt's implementation:

var myArray [24]byte
for i := 0; i < 24; i += 8 {
  _ = myArray[i:i+8]  // bound check
}

Comment From: randall77

@jvoisin Your example seems to be fixed at tip (but not 1.25rc2). The OP's example is not fixed yet.