You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@peterahrens send me on a goose chase, which led me down to a peculiar observation. Given a relatively simple reduction loop (intentionally not using @simd here):
functionvecfail(A)
@inboundsbegin
acc =zero(eltype(A))
N =length(A)
for I inCartesianIndices(A)
acc = Base.FastMath.add_fast(acc, A[I])
endendreturn acc
end
@peterahrens send me on a goose chase, which led me down to a peculiar observation. Given a relatively simple reduction loop (intentionally not using
@simd
here):Turns into this nice loop before
loop-vectorize
, https://godbolt.org/z/aIU_3uIf one comments out either
%14
or%13
and uses the version below the function vectorize just find.I came up with two fixes to Base.
Change
iterate
Change
inc
to useunsafe_inc
It would be nice if we could convince LLVM to do this reasoning for us.
Some random data I collected as well:
The text was updated successfully, but these errors were encountered: