Go version
go tip
Output of go env in your module/workspace:
What did you do?
I wrote* some archsimd code over lunch to measure the performance of some simple loops.
I wrote some code to count the number of uppercase ASCII letters in a buffer.
I wrote a scalar and AVX2 version. Both of them had their bounds checks eliminated entirely (yay!).
I than wrote a 4x unrolled versions of the scalar and AVX2 loops (as well as a 2x unrolled variants), to avoid a loop-carried dependency on the "count" variable.
(* full disclosure: I was using this to test out a new AI coding agent, but I personally reviewed all generated code)
What did you see happen?
It looks like the 4x unrolled versions did not have bounds-checks eliminated.
What did you expect to see?
I expected bounds-check eliminations to still work, even with the 4x unrolled variants.
Especially because my overall program harness had AVX2 variant reading 32 bytes at a time, with bounds checks eliminated, and a 2xAVX variant (also reading 32 bytes per loop iteration, split over 2 registers/counters). The latter did not have bounds checks eliminated, as far as I can tell.
Go version
go tip
Output of
go envin your module/workspace:What did you do?
I wrote* some archsimd code over lunch to measure the performance of some simple loops.
I wrote some code to count the number of uppercase ASCII letters in a buffer.
I wrote a scalar and AVX2 version. Both of them had their bounds checks eliminated entirely (yay!).
I than wrote a 4x unrolled versions of the scalar and AVX2 loops (as well as a 2x unrolled variants), to avoid a loop-carried dependency on the "count" variable.
(* full disclosure: I was using this to test out a new AI coding agent, but I personally reviewed all generated code)
What did you see happen?
It looks like the 4x unrolled versions did not have bounds-checks eliminated.
What did you expect to see?
I expected bounds-check eliminations to still work, even with the 4x unrolled variants.
Especially because my overall program harness had AVX2 variant reading 32 bytes at a time, with bounds checks eliminated, and a 2xAVX variant (also reading 32 bytes per loop iteration, split over 2 registers/counters). The latter did not have bounds checks eliminated, as far as I can tell.