Skip to content

Cannot run project due error unsupported llvm intrinsic llvm.prefetch - trap at Instance ... llvm.x86.avx2.psad.bw #1406

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

Closed
qarmin opened this issue Oct 31, 2023 · 6 comments · Fixed by #1417
Labels
A-core-arch Area: Necessary for full core::arch support

Comments

@qarmin
Copy link

qarmin commented Oct 31, 2023

Steps to reproduce

git clone https://github.com/qarmin/czkawka.git
cd czkawka
git checkout 4ae23037e493bc6af7f5e257f8220fd097e3dba4
cd czkawka_slint_gui
CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly run -Zcodegen-backend

Error

warning: unsupported llvm intrinsic llvm.prefetch; replacing with trap

warning: `czkawka_core` (lib) generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 2m 00s
rafal@rafal-H87M-D3H:~/Projekty/Rust/czkawka/czkawka_slint_gui$ CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly run -Zcodegen-backend
warning: unsupported llvm intrinsic llvm.prefetch; replacing with trap

warning: `czkawka_core` (lib) generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 1.80s
     Running `/home/rafal/Projekty/Rust/czkawka/target/debug/czkawka_slint`
trap at Instance { def: Item(DefId(2:14641 ~ core[53bd]::core_arch::x86::avx2::_mm256_sad_epu8)), args: [] } (_ZN4core9core_arch3x864avx215_mm256_sad_epu817h452ea8cc02b4bc52E): llvm.x86.avx2.psad.bw

@bjorn3
Copy link
Member

bjorn3 commented Oct 31, 2023

Turns out cg_clif miscompiled is_x86_feature_detected!() such that AVX is never detected: #1405 (comment) This has resulted in me not noticing all the AVX intrinsics that crates rely on. When using the rustup component, an LLVM compiled libstd will be used which has a correct is_x86_feature_detected!() which does detect AVX. I will work on implementing this AVX vendor intrinsic tomorrow.

@bjorn3 bjorn3 added the A-core-arch Area: Necessary for full core::arch support label Oct 31, 2023
@bjorn3
Copy link
Member

bjorn3 commented Nov 5, 2023

I can't directly reproduce this as I'm testing it on a server without gui support. Assuming this issue originates from the image crate, I can reproduce it using the test suite of the image crate. Working on a fix right now.

@bjorn3
Copy link
Member

bjorn3 commented Nov 5, 2023

If it was indeed the image crate being broken, a fix should now be available on the implement_xgetbv branch.

@bjorn3
Copy link
Member

bjorn3 commented Nov 11, 2023

Can you try again with the latest nightly? The image crate should now fully work.

@qarmin
Copy link
Author

qarmin commented Nov 11, 2023

I tried day or two day ago to run in after using rustup update, but it was still broken.

But when I run it via - https://github.com/rust-lang/rustc_codegen_cranelift/releases/tag/dev - then everything works fine.

@bjorn3
Copy link
Member

bjorn3 commented Nov 11, 2023

I tried day or two day ago to run in after using rustup update, but it was still broken.

The subtree sync only just landed in the latest nightly.

But when I run it via - https://github.com/rust-lang/rustc_codegen_cranelift/releases/tag/dev - then everything works fine.

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core-arch Area: Necessary for full core::arch support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants