Conversation
|
Of course: @nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
|
The regressions in any/all that Nanosoldier flagged are indeed real and I can reproduce them locally. The only difference within the loop of the generated LLVM is using an That said, In any case, I still think think this is worth doing as it adds a layer of protection if we decide to go in on the unsafe-iteration-by-default-when-guaranteed-by-lowering. |
|
Oh, of course, I cannot test for vectorization on CI because of |
Currently, if a vector is resized in the midst of iteration, then `done` might "miss" the end of iteration. This trivially changes the definition to catch such a case. I am not sure what guarantees we make about mutating iterables during iteration, but this seems simple and easy to support. Note, though, that it is somewhat tricky: until #13866 we used `i > length(a)`, but that foils vectorization due to the `typemax` case. This definition seems to get the best of both worlds. For a definition like `f` below, this new definition just requires one extra `add i64` operation in the preamble (before the loop). Everything else is identical to master. ```julia function f(A) r = 0 @inbounds for x in A r += x end r end ```
d13c26f to
bfd8462
Compare
|
FreeBSD failed with a And macOS was #26725. |
Currently, if a vector is resized in the midst of iteration, then
donemight "miss" the end of iteration. This trivially changes the definition to catch such a case. I am not sure what guarantees we make about mutating iterables during iteration, but this seems simple and easy to support. Note, though, that it is somewhat tricky: until #13866 we usedi > length(a), but that foils vectorization due to thetypemaxcase. This definition seems to get the best of both worlds. For a definition likefbelow, this new definition just requires one extraadd i64operation in the preamble (before the loop). Everything else is identical to master.Motivated by https://stackoverflow.com/questions/50297791/julia-boundserror-when-deleting-items-of-a-list-while-iterating-over-it