[llvm] 2867510 - [X86] Add test coverage for #89533
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 03:29:47 PDT 2024
Author: Simon Pilgrim
Date: 2024-04-26T11:28:56+01:00
New Revision: 28675109ccb69fbb6de93167a66a93663ceed65e
URL: https://github.com/llvm/llvm-project/commit/28675109ccb69fbb6de93167a66a93663ceed65e
DIFF: https://github.com/llvm/llvm-project/commit/28675109ccb69fbb6de93167a66a93663ceed65e.diff
LOG: [X86] Add test coverage for #89533
Added:
Modified:
llvm/test/CodeGen/X86/combine-or.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/combine-or.ll b/llvm/test/CodeGen/X86/combine-or.ll
index 57679f7e8f1fd4..8419001de236c6 100644
--- a/llvm/test/CodeGen/X86/combine-or.ll
+++ b/llvm/test/CodeGen/X86/combine-or.ll
@@ -182,7 +182,108 @@ define i32 @or_and_multiuse_and_multiuse_i32(i32 %x, i32 %y) nounwind {
ret i32 %r
}
+define i64 @or_build_pair_not(i32 %a0, i32 %a1) {
+; CHECK-LABEL: or_build_pair_not:
+; CHECK: # %bb.0:
+; CHECK-NEXT: # kill: def $esi killed $esi def $rsi
+; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
+; CHECK-NEXT: notl %edi
+; CHECK-NEXT: notl %esi
+; CHECK-NEXT: shlq $32, %rsi
+; CHECK-NEXT: leaq (%rsi,%rdi), %rax
+; CHECK-NEXT: retq
+ %n0 = xor i32 %a0, -1
+ %n1 = xor i32 %a1, -1
+ %x0 = zext i32 %n0 to i64
+ %x1 = zext i32 %n1 to i64
+ %hi = shl i64 %x1, 32
+ %r = or i64 %hi, %x0
+ ret i64 %r
+}
+
+define i64 @PR89533(<64 x i8> %a0) {
+; SSE-LABEL: PR89533:
+; SSE: # %bb.0:
+; SSE-NEXT: movdqa {{.*#+}} xmm4 = [95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95]
+; SSE-NEXT: pcmpeqb %xmm4, %xmm0
+; SSE-NEXT: pmovmskb %xmm0, %eax
+; SSE-NEXT: xorl $65535, %eax # imm = 0xFFFF
+; SSE-NEXT: pcmpeqb %xmm4, %xmm1
+; SSE-NEXT: pmovmskb %xmm1, %ecx
+; SSE-NEXT: notl %ecx
+; SSE-NEXT: shll $16, %ecx
+; SSE-NEXT: orl %eax, %ecx
+; SSE-NEXT: pcmpeqb %xmm4, %xmm2
+; SSE-NEXT: pmovmskb %xmm2, %edx
+; SSE-NEXT: xorl $65535, %edx # imm = 0xFFFF
+; SSE-NEXT: pcmpeqb %xmm4, %xmm3
+; SSE-NEXT: pmovmskb %xmm3, %eax
+; SSE-NEXT: notl %eax
+; SSE-NEXT: shll $16, %eax
+; SSE-NEXT: orl %edx, %eax
+; SSE-NEXT: shlq $32, %rax
+; SSE-NEXT: orq %rcx, %rax
+; SSE-NEXT: je .LBB11_2
+; SSE-NEXT: # %bb.1: # %cond.false
+; SSE-NEXT: rep bsfq %rax, %rax
+; SSE-NEXT: retq
+; SSE-NEXT: .LBB11_2: # %cond.end
+; SSE-NEXT: movl $64, %eax
+; SSE-NEXT: retq
+;
+; AVX1-LABEL: PR89533:
+; AVX1: # %bb.0:
+; AVX1-NEXT: vbroadcastss {{.*#+}} xmm2 = [95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95]
+; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm3
+; AVX1-NEXT: vpmovmskb %xmm3, %eax
+; AVX1-NEXT: xorl $65535, %eax # imm = 0xFFFF
+; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
+; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
+; AVX1-NEXT: vpmovmskb %xmm0, %ecx
+; AVX1-NEXT: notl %ecx
+; AVX1-NEXT: shll $16, %ecx
+; AVX1-NEXT: orl %eax, %ecx
+; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm0
+; AVX1-NEXT: vpmovmskb %xmm0, %edx
+; AVX1-NEXT: xorl $65535, %edx # imm = 0xFFFF
+; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm0
+; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
+; AVX1-NEXT: vpmovmskb %xmm0, %eax
+; AVX1-NEXT: notl %eax
+; AVX1-NEXT: shll $16, %eax
+; AVX1-NEXT: orl %edx, %eax
+; AVX1-NEXT: shlq $32, %rax
+; AVX1-NEXT: orq %rcx, %rax
+; AVX1-NEXT: je .LBB11_2
+; AVX1-NEXT: # %bb.1: # %cond.false
+; AVX1-NEXT: rep bsfq %rax, %rax
+; AVX1-NEXT: vzeroupper
+; AVX1-NEXT: retq
+; AVX1-NEXT: .LBB11_2: # %cond.end
+; AVX1-NEXT: movl $64, %eax
+; AVX1-NEXT: vzeroupper
+; AVX1-NEXT: retq
+;
+; AVX2-LABEL: PR89533:
+; AVX2: # %bb.0:
+; AVX2-NEXT: vpbroadcastb {{.*#+}} ymm2 = [95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95]
+; AVX2-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
+; AVX2-NEXT: vpmovmskb %ymm0, %eax
+; AVX2-NEXT: notl %eax
+; AVX2-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm0
+; AVX2-NEXT: vpmovmskb %ymm0, %ecx
+; AVX2-NEXT: notl %ecx
+; AVX2-NEXT: shlq $32, %rcx
+; AVX2-NEXT: orq %rax, %rcx
+; AVX2-NEXT: xorl %eax, %eax
+; AVX2-NEXT: tzcntq %rcx, %rax
+; AVX2-NEXT: vzeroupper
+; AVX2-NEXT: retq
+ %cmp = icmp ne <64 x i8> %a0, <i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95, i8 95>
+ %mask = bitcast <64 x i1> %cmp to i64
+ %tz = tail call i64 @llvm.cttz.i64(i64 %mask, i1 false)
+ ret i64 %tz
+}
+
declare void @use_i32(i32)
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; AVX1: {{.*}}
-; AVX2: {{.*}}
+
More information about the llvm-commits
mailing list