-
Notifications
You must be signed in to change notification settings - Fork 287
[llvm9 regression] i586-unknown-linux-gnu does not generate movmskps anymore #794
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
Comments
Rust nightly MWE: https://godbolt.org/z/fA5UNl Using the generated LLVM-IR: https://godbolt.org/z/LU7i9q source_filename = "example.3a1fbbbh-cgu.0"
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i586-unknown-linux-gnu"
define i32 @_ZN7example15_mm_movemask_ps17h7f545271133b7928E(<4 x float>* noalias nocapture readonly dereferenceable(16) %a) unnamed_addr #0 {
start:
%0 = bitcast <4 x float>* %a to <4 x i32>*
%1 = load <4 x i32>, <4 x i32>* %0, align 16
%2 = icmp slt <4 x i32> %1, zeroinitializer
%3 = bitcast <4 x i1> %2 to i4
%4 = zext i4 %3 to i32
ret i32 %4
}
attributes #0 = { norecurse nounwind nonlazybind readonly "probe-stack"="__rust_probestack" "target-cpu"="pentium" "target-features"="+sse" }
!llvm.module.flags = !{!0}
!0 = !{i32 2, !"RtLibUseGOT", i32 1} I cannot generate the old machine code using any |
Using Rust 1.36.0: https://godbolt.org/z/k22p47 does generate example::_mm_movemask_ps:
mov eax, dword ptr [esp + 4]
movaps xmm0, xmmword ptr [eax]
movmskps eax, xmm0
ret
.Lfunc_end0: and the LLVM-IR generated: https://godbolt.org/z/oMW4OK is source_filename = "example.3a1fbbbh-cgu.0"
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i586-unknown-linux-gnu"
define i32 @_ZN7example15_mm_movemask_ps17h9d7ca884d8f840c4E(<4 x float>* noalias nocapture readonly dereferenceable(16) %a) unnamed_addr #0 {
start:
%0 = load <4 x float>, <4 x float>* %a, align 16
%1 = tail call i32 @llvm.x86.sse.movmsk.ps(<4 x float> %0) #2
ret i32 %1
}
declare i32 @llvm.x86.sse.movmsk.ps(<4 x float>) unnamed_addr #1
attributes #0 = { nounwind nonlazybind readonly "probe-stack"="__rust_probestack" "target-cpu"="pentium" "target-features"="+sse" }
attributes #1 = { nounwind readnone }
attributes #2 = { nounwind }
!llvm.module.flags = !{!0}
!0 = !{i32 2, !"RtLibUseGOT", i32 1} notice how the |
Found the bug. The bug is in opt: https://godbolt.org/z/vVVDFd |
Opened LLVM bug: https://bugs.llvm.org/show_bug.cgi?id=42870 |
The LLVM bug was resolved on 2020-03-24. I find this issue from: stdarch/crates/core_arch/src/x86/sse.rs Lines 1081 to 1090 in b168a4c
|
This does looks like a regression with the LLVM9 update @nikic . The
_mm_movemask_ps
intrinsic used to generate a singlemovmskps
instruction with LLVM8 on thei586-unknown-linux-gnu
target, and now it generates:The text was updated successfully, but these errors were encountered: