New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@simd
is unsound
#26976
Labels
compiler:codegen
Generation of LLVM IR and native code
compiler:simd
instruction-level vectorization
Comments
Keno
added a commit
that referenced
this issue
May 4, 2018
Previously the simdloop marker was metadata on a random add instruction in the loop. This is problematic if that add instruction gets moved around or folded by an earlier optimization pass. Switching to using an explicit marker instruction. Eventually we should do something different here to address #26976. This just makes it more robust to make sure it keeps working with the new optimizer.
Keno
added a commit
that referenced
this issue
May 5, 2018
Previously the simdloop marker was metadata on a random add instruction in the loop. This is problematic if that add instruction gets moved around or folded by an earlier optimization pass. Switching to using an explicit marker instruction. Eventually we should do something different here to address #26976. This just makes it more robust to make sure it keeps working with the new optimizer.
Keno
added a commit
that referenced
this issue
May 6, 2018
Previously the simdloop marker was metadata on a random add instruction in the loop. This is problematic if that add instruction gets moved around or folded by an earlier optimization pass. Switching to using an explicit marker instruction. Eventually we should do something different here to address #26976. This just makes it more robust to make sure it keeps working with the new optimizer.
Keno
added a commit
that referenced
this issue
May 6, 2018
Previously the simdloop marker was metadata on a random add instruction in the loop. This is problematic if that add instruction gets moved around or folded by an earlier optimization pass. Switching to using an explicit marker instruction. Eventually we should do something different here to address #26976. This just makes it more robust to make sure it keeps working with the new optimizer.
Fixed by #26985? |
No, that was just a bandaid. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler:codegen
Generation of LLVM IR and native code
compiler:simd
instruction-level vectorization
The
@simd
macro works by attach metadata to an instruction in the current insert block and then enabling unsafe algebra (amongst other things) on all instructions contained within theloop
(as determined by LLVM). The problem with this is that the annotation runs after an initial round of LLVM optimizations, so LLVM's notion of the containingloop
may not match the loop annotated by@simd
. A better design would explicitly demarcate the loop body (e.g. by a pair of markers) and limit modifications to that region.The text was updated successfully, but these errors were encountered: