Skip to content

Commit 9b44239

Browse files
authored
Remove some UB from examples in performance tips (#54221)
Remove some UB from examples in performance tips Fixes #54218 I also changed the iteration specification to better align with elsewhere in the document. A separate PR may want to delete or revise this section if automatic simd has improved. Nevertheless, I think this PR should be unobjectionable as is.
1 parent d645fed commit 9b44239

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/src/manual/performance-tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,15 +1446,15 @@ the optimizer from trying to be too clever and defeat our benchmark):
14461446
```julia
14471447
@noinline function inner(x, y)
14481448
s = zero(eltype(x))
1449-
for i=eachindex(x)
1449+
for i in eachindex(x, y)
14501450
@inbounds s += x[i]*y[i]
14511451
end
14521452
return s
14531453
end
14541454

14551455
@noinline function innersimd(x, y)
14561456
s = zero(eltype(x))
1457-
@simd for i = eachindex(x)
1457+
@simd for i in eachindex(x, y)
14581458
@inbounds s += x[i] * y[i]
14591459
end
14601460
return s

0 commit comments

Comments
 (0)