-
Notifications
You must be signed in to change notification settings - Fork 277
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
rustc crashes when trying to bench upcoming neon-support in RustFFT with latest stdarch. #1227
Comments
Please include |
Sure! It doesn't say that much unfortunately.
|
Can you find out which lines of code in the bench caused the crash? This might help to find the root cause. |
This is what I wanted to make sure of. |
It doesn't seem to matter much what my benches contain, it fails no matter what. I just started building rustc from today, will try it as soon as it's ready (tomorrow probably, takes some time on a Raspberry Pi..) |
|
I need a newer stdarch than in the latest nightly, with all the vld* and vst* intrinsics. |
The updated llvm unfortunately made no difference. If I go back to the RustFFT version just before I started using the vld* and vst* intrinsics builds and benches fine. I'll try to figure out exactly what change triggers the crash. Unfortunately I'm a bit short on time these days, so may take a while. |
The crash seems to come when I compile a benchmark if my FFTs use this function: https://github.com/HEnquist/RustFFT/blob/vldx/src/neon/neon_vector.rs#L156 |
We can replace
|
Using the |
By the way, |
That is interesting. I think |
Can you show the assembly emitted for each of those intrinsics, as it looks like in the final bench binary, @HEnquist? This will likely require a disassembly tool rather than relying on |
I have looked at this a bit and can reproduce this on a Mac M1. Rustc crashes in LLVM codegen:
Full backtrace:
Trying to narrow it down:
With |
I didn't have any time to continue on this (and I think that I probably know too little about this stuff to be useful anyway). Did anyone else make any progress? |
Rust recently upgraded to LLVM 14, can you try this on the latest nightly to see if it is still an issue? |
I'll try asap and report back! |
I just tried this, and unfortunately the newer LLVM doesn't seem to make any difference. |
I think rustc generates correct instructions. https://developer.arm.com/architectures/instruction-sets/intrinsics/vld2q_f64 use core::arch::aarch64::*;
#[inline(never)]
pub unsafe fn vld2q_f64_real(p: *const f64) -> float64x2x2_t {
vld2q_f64(p)
}
#[inline(never)]
pub unsafe fn vld2q_f64_fake(a: *const f64) -> float64x2x2_t {
let x: [float64x1_t; 4] = core::ptr::read_unaligned(a.cast());
core::mem::transmute([x[0], x[2], x[1], x[3]])
} example::vld2q_f64_real:
ld2 { v0.2d, v1.2d }, [x0]
stp q0, q1, [x8]
ret
example::vld2q_f64_fake:
ldp d0, d2, [x0]
ldp d1, d3, [x0, #16]
str d0, [x8]
str d2, [x8, #16]
str d1, [x8, #8]
str d3, [x8, #24]
ret It may be related with a recent issue. The latest nightly has upgraded to LLVM 15.0.4. |
I just got back to this after a small break :) |
I'm working on adding neon support to RustFFT, and wanted to try the
vld*
andvst*
instrinsics added here: #1224First results were promising, but now I'm having a hard time running benchmarks because rustc crashes when building the benches. It crashes quite hard, without giving any useful error message. I'm using rust commit
d14731c
(simply master from yesterday, have also tried with a version from a couple of days ago with the same result), with stdarch updated to commit931cdfb
.I would like to investigate this and try to at least help solve it, but I have no idea were to start. Any advice?
I'm trying to bench this branch: https://github.com/HEnquist/RustFFT/tree/vldx
I have tried on both a raspberry pi, and on an Oracle Ampere VM, with the same results.
Error:
The text was updated successfully, but these errors were encountered: