[llvm] c8b85ad - [X86] extractelement-load.ll - add test case for #85419
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 09:14:31 PDT 2024
Author: Simon Pilgrim
Date: 2024-03-26T16:14:11Z
New Revision: c8b85add2ec1916f3aa5139dfd258e42a946a468
URL: https://github.com/llvm/llvm-project/commit/c8b85add2ec1916f3aa5139dfd258e42a946a468
DIFF: https://github.com/llvm/llvm-project/commit/c8b85add2ec1916f3aa5139dfd258e42a946a468.diff
LOG: [X86] extractelement-load.ll - add test case for #85419
Added:
Modified:
llvm/test/CodeGen/X86/extractelement-load.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/extractelement-load.ll b/llvm/test/CodeGen/X86/extractelement-load.ll
index 9a5f296f4516c1..e3e1cdcd7f56ee 100644
--- a/llvm/test/CodeGen/X86/extractelement-load.ll
+++ b/llvm/test/CodeGen/X86/extractelement-load.ll
@@ -283,6 +283,47 @@ entry:
ret float %cond
}
+define i32 @PR85419(ptr %p0) {
+; X86-SSE2-LABEL: PR85419:
+; X86-SSE2: # %bb.0:
+; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-SSE2-NEXT: movdqa (%eax), %xmm0
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,1,1]
+; X86-SSE2-NEXT: movd %xmm1, %ecx
+; X86-SSE2-NEXT: xorl %edx, %edx
+; X86-SSE2-NEXT: orl (%eax), %ecx
+; X86-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,2,3]
+; X86-SSE2-NEXT: movd %xmm0, %eax
+; X86-SSE2-NEXT: cmovel %edx, %eax
+; X86-SSE2-NEXT: retl
+;
+; X64-SSSE3-LABEL: PR85419:
+; X64-SSSE3: # %bb.0:
+; X64-SSSE3-NEXT: xorl %ecx, %ecx
+; X64-SSSE3-NEXT: cmpq $0, (%rdi)
+; X64-SSSE3-NEXT: pshufd {{.*#+}} xmm0 = mem[2,3,2,3]
+; X64-SSSE3-NEXT: movd %xmm0, %eax
+; X64-SSSE3-NEXT: cmovel %ecx, %eax
+; X64-SSSE3-NEXT: retq
+;
+; X64-AVX-LABEL: PR85419:
+; X64-AVX: # %bb.0:
+; X64-AVX-NEXT: xorl %eax, %eax
+; X64-AVX-NEXT: cmpq $0, (%rdi)
+; X64-AVX-NEXT: je .LBB8_2
+; X64-AVX-NEXT: # %bb.1:
+; X64-AVX-NEXT: movl 8(%rdi), %eax
+; X64-AVX-NEXT: .LBB8_2:
+; X64-AVX-NEXT: retq
+ %load = load <2 x i64>, ptr %p0, align 16
+ %vecext.i = extractelement <2 x i64> %load, i64 0
+ %cmp = icmp eq i64 %vecext.i, 0
+ %.cast = bitcast <2 x i64> %load to <4 x i32>
+ %vecext.i2 = extractelement <4 x i32> %.cast, i64 2
+ %retval.0 = select i1 %cmp, i32 0, i32 %vecext.i2
+ ret i32 %retval.0
+}
+
; Test for bad extractions from a VBROADCAST_LOAD of the <2 x i16> non-uniform constant bitcast as <4 x i32>.
define void @subextract_broadcast_load_constant(ptr nocapture %0, ptr nocapture %1, ptr nocapture %2) nounwind {
; X86-SSE2-LABEL: subextract_broadcast_load_constant:
More information about the llvm-commits
mailing list