Skip to content
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 assertion in simdnoise crate #56483

Closed
pietroalbini opened this issue Dec 3, 2018 · 8 comments · Fixed by #79938
Closed

LLVM assertion in simdnoise crate #56483

pietroalbini opened this issue Dec 3, 2018 · 8 comments · Fixed by #79938
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pietroalbini
Copy link
Member

The simdnoise crate is failing to build with an LLVM assertion:

rustc: /checkout/src/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp:118: static uint8_t (anonymous namespace)::X86MCCodeEmitter::ModRMByte(unsigned int, unsigned int, unsigned int): Assertion `Mod < 4 && RegOpcode < 8 && RM < 8 && "ModRM Fields out of range!"' failed.

This is not a regression, it's confirmed to also fail on 1.28.0 (alt builds are not available past that).

@alexcrichton alexcrichton added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-codegen Area: Code generation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 3, 2018
@jonas-schievink
Copy link
Contributor

Wow, this one's amazing.

@nikic
Copy link
Contributor

nikic commented Dec 4, 2018

This one still reproduces on master.

@nikic
Copy link
Contributor

nikic commented Dec 4, 2018

Unfortunately, I wasn't able to get this to assert with --emit=llvm-bc and a separate llc invocation.

@FrankSD
Copy link

FrankSD commented Dec 9, 2018

Can an absolute beginner take this one?Let me know if someone is working on this already

@jonas-schievink
Copy link
Contributor

@FrankSD This is an assertion failure in the very depths of LLVM's machine code backend, you can try to find a minimal test case if you want, but I wouldn't recommend finding or fixing the actual bug to a beginner (but feel free to try if you feel very ambitious!). You can also try your hand at one of the E-Easy issues, which are specifically meant for beginners.

@mati865
Copy link
Contributor

mati865 commented Jan 15, 2019

I can reproduce it with some old nightlies but rustc 1.33.0-nightly (03acbd71c 2019-01-14) works just fine.

@nikic
Copy link
Contributor

nikic commented Jan 30, 2019

@mati865 Did you use an assertion-enabled build? I tried again just now and am still seeing the assertion:

nikic@helios:~/rust-simd-noise$ rustc +ae1ba150a280ebe428c760fbbbd58ae758ba9ea7-alt -V
rustc 1.34.0-nightly (ae1ba150a 2019-01-29)
nikic@helios:~/rust-simd-noise$ cargo +ae1ba150a280ebe428c760fbbbd58ae758ba9ea7-alt build
   Compiling simdeez v0.4.2
   Compiling simdnoise v2.3.6 (/home/nikic/rust-simd-noise)
rustc: /checkout/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp:118: static uint8_t (anonymous namespace)::X86MCCodeEmitter::ModRMByte(unsigned int, unsigned int, unsigned int): Assertion `Mod < 4 && RegOpcode < 8 && RM < 8 && "ModRM Fields out of range!"' failed.
error: Could not compile `simdnoise`.

@mati865
Copy link
Contributor

mati865 commented Jan 30, 2019

@nikic my bad, new nightly builds don't have llvm assertions enabled.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 12, 2020
Update stdarch submodule

Changes included:

* Use a bootstrap guard for modules with new target features
* Avoid calling intrinsics with invalid const arguments
* Avx512bw
* Avx512cd
* Add AVX512BITALG
* Add GFNI Intrinsics
* Add AVX512VPOPCNTDQ Intrinsics
* Add VPCLMULQDQ Intrinsics
* Avx512bw
* Reimplement `_xgetbv` with LLVM intrinsics
* Avx512bw
* Add reamained vmax and vmin via auto-generated code
* Add VAES intrinsics

Fixes rust-lang#56483.
@bors bors closed this as completed in 8b3ee82 Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants