[llvm] r344331 - [X86] Ignore float/double non-temporal loads (PR39256)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 12 03:20:16 PDT 2018
Author: rksimon
Date: Fri Oct 12 03:20:16 2018
New Revision: 344331
URL: http://llvm.org/viewvc/llvm-project?rev=344331&view=rev
Log:
[X86] Ignore float/double non-temporal loads (PR39256)
Scalar non-temporal loads were asserting instead of just being ignored.
Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10895
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/test/CodeGen/X86/nontemporal-loads.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=344331&r1=344330&r2=344331&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Fri Oct 12 03:20:16 2018
@@ -441,6 +441,9 @@ namespace {
switch (StoreSize) {
default: llvm_unreachable("Unsupported store size");
+ case 4:
+ case 8:
+ return false;
case 16:
return Subtarget->hasSSE41();
case 32:
Modified: llvm/trunk/test/CodeGen/X86/nontemporal-loads.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/nontemporal-loads.ll?rev=344331&r1=344330&r2=344331&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/nontemporal-loads.ll (original)
+++ llvm/trunk/test/CodeGen/X86/nontemporal-loads.ll Fri Oct 12 03:20:16 2018
@@ -1911,4 +1911,36 @@ define <16 x i32> @test_masked_v16i32(i8
ret <16 x i32>%res
}
+; Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10895
+define i32 @PR39256(float* %ptr) {
+; SSE-LABEL: PR39256:
+; SSE: # %bb.0: # %entry
+; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; SSE-NEXT: ucomiss {{.*}}(%rip), %xmm0
+; SSE-NEXT: setb (%rax)
+; SSE-NEXT: movl $-2147483648, %eax # imm = 0x80000000
+; SSE-NEXT: retq
+;
+; AVX-LABEL: PR39256:
+; AVX: # %bb.0: # %entry
+; AVX-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; AVX-NEXT: vucomiss {{.*}}(%rip), %xmm0
+; AVX-NEXT: setb (%rax)
+; AVX-NEXT: movl $-2147483648, %eax # imm = 0x80000000
+; AVX-NEXT: retq
+;
+; AVX512-LABEL: PR39256:
+; AVX512: # %bb.0: # %entry
+; AVX512-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
+; AVX512-NEXT: vucomiss {{.*}}(%rip), %xmm0
+; AVX512-NEXT: setb (%rax)
+; AVX512-NEXT: movl $-2147483648, %eax # imm = 0x80000000
+; AVX512-NEXT: retq
+entry:
+ %l = load float, float* %ptr, !nontemporal !1
+ %C = fcmp ult float %l, 0x36A0000000000000
+ store i1 %C, i1* undef
+ ret i32 -2147483648
+}
+
!1 = !{i32 1}
More information about the llvm-commits
mailing list