-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 regression in beta with -Ctarget-feature=-simd128
#131031
Comments
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Note that enabling simd128 only for some functions is not really useful because wasm doesn’t support dynamic feature detection: the entire module has to pass validation before any of it is executed, so either you have SIMD support or your module won’t load anyway. See https://doc.rust-lang.org/core/arch/wasm32/index.html#simd and BurntSushi/memchr#144 for discussion. There’s still a bug here that should be fixed, but the workaround of building the entire program (except the sysroot) with |
Looks like CoalesceFeaturesAndStripAtomics replaces |
Unfortunately, I can't seem to figure out how to reproduce this outside rustc. Just feeding the IR through llc gives be |
@alexcrichton Do you happen to know whether there is some kind of special option one has to pass to llc to reproduce how rust emits wasm? |
This is a part of LLVM I've never personally fully understood but I believe that the target-feature attribute on functions is not equivalent to what's passed on the command line. I got the above to crash and with
which is a long way of saying "maybe |
@alexcrichton Oh yeah, that's what I was missing. It looks like the behavior for this case was changed in llvm/llvm-project#80094, but it doesn't explain the reasoning behind it. Edit: I think what that PR should probably have done is to explicitly materialize the |
Ah yeah I also don't know the motivation of that PR or what's behind it either. I've often run into small issues as well here and there with features and LLVM and I'm not sure if it's something that the WebAssembly backend is doing wrong or differently than other backends, or if it's just that I was holding things wrong at the time. I don't have anything specific on-hand though. |
Candidate fix: llvm/llvm-project#110647 Unfortunately we can't actually use |
@rustbot label -llvm-fixed-upstream +O-wasm |
The failure output is: ``` SplitVectorOperand Op #1: t51: i32 = llvm.wasm.alltrue TargetConstant:i32<12408>, t50 rustc-LLVM ERROR: Do not know how to split this operator's operand! ```
Update LLVM to 19.1.3 Closes rust-lang#131031. r? nikic
Code
I tried this code:
Flags:
-Ctarget-feature=-simd128 --target wasm32-wasip1
Godbolt
I expected to see this happen: compiles
Instead, this happened: fails to compile with "rustc-LLVM ERROR: Do not know how to split this operator's operand!"
Version it worked on
It most recently worked on: 1.81.0
Version with regression
rustc --version --verbose
:@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged +A-LLVM
The text was updated successfully, but these errors were encountered: