-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
LLVM crash with SIMD types and inline asm #27333
Comments
Maybe I am not seeing something but arm neon can only handle 64 and128 bit simd operations. So might that be why your previous version with 2 u64x2 version worked instead of the u64x4? Your current version is trying to allocate a 256 bit number which is larger than what is supported. |
@phillipCouto SSE2 can also handle only 64 and 128 bit SIMD. LLVM is able to work with a u64x4 just fine; it uses a pair of registers instead of a single one, both for SSE2 and NEON. And the inline asm still receives a single u64x2 like before; I extract both halves of the u64x4, and call the inline asm once with each, as can be seen in the link I provided. |
We should limit |
cc #38735 |
An issue with more discussion is #39083 - all of these have in common the fact that we're not limiting the types anyone can pass to |
I was going to say "this is actually easy, copy a check from here to there", but, well, variadics only blacklist. That said, whitelisting inline assembly shouldn't be too difficult - the condition would most likely be along the lines of |
The new |
I wrote some code which extracts the two halves of a u64x4, calls some arm neon inline assembly on each half, and combines them again. Trying to compile that code for arm crashes the compiler deep in the LLVM code.
I had previously used the exact same inline assembly without any problem, but I rewrote the surrounding code (previously, the two halves were already kept separate as a pair of u64x2).
The crashing code can be found at cesarb/blake2-rfc@36708b2 (the working code with the same inline asm can be found two commits before that one). Unfortunately, I failed to extract a reduced testcase; the crash only happens when the code is inlined inside the rest of the BLAKE2 core. The crash location within the LLVM code seems to point to some register allocation issue.
To reproduce the crash, you need a nightly rustc configured for cross-compiling to android, checkout that commit, and run the following command:
cargo build -v --release --features="bench simd_asm" --target=arm-linux-androideabi
(the offending code is gated by the "simd_asm" feature in theCargo.toml
).Expected result: compile correctly so I can copy and modify the rustc command line to add a
-C target-cpu=cortex-a9 -C target-feature=+neon
and run the tests and benchmarks on my phone.What happens:
Process didn't exit successfully: [...] (signal: 4)
(which is SIGILL according tokill -l
). Usingrust-gdb
reveals the crash is deep within the LLVM code.Versions:
The text was updated successfully, but these errors were encountered: