Author: Shengchen Kan
Date: 2023-11-30T17:56:21+08:00
New Revision: eb64697a7b75d2b22041cc992fad0c8dfa7989cb
URL:
https://github.com/llvm/llvm-project/commit/eb64697a7b75d2b22041cc992fad0c8dfa7989cb
DIFF:
https://github.com/llvm/llvm-project/commit/eb64697a7b75d2b22041cc992fad0c8dfa7989cb.diff
LOG: [X86][Codegen] Correct the domain of VP2INTERSECT
GenericDomain -> SSEPackedInt
Found by #73654
Added:
Modified:
llvm/lib/Target/X86/X86InstrAVX512.td
llvm/test/CodeGen/X86/avx512vlvp2intersect-intrinsics.ll
llvm/test/CodeGen/X86/avx512vp2intersect-intrinsics.ll
llvm/test/CodeGen/X86/stack-folding-avx512vp2intersect.ll
llvm/test/CodeGen/X86/vp2intersect_multiple_pairs.ll
Removed:
diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td
b/llvm/lib/Target/X86/X86InstrAVX512.td
index f325f47d46464c3..0514f0d19506707 100644
--- a/llvm/lib/Target/X86/X86InstrAVX512.td
+++ b/llvm/lib/Target/X86/X86InstrAVX512.td
@@ -12875,8 +12875,10 @@ multiclass avx512_vp2intersect;
defm VP2INTERSECTQ : avx512_vp2intersect,
REX_W;
+}
multiclass avx512_binop_all2 opc, string OpcodeStr,
X86SchedWriteWidths sched,
diff --git a/llvm/test/CodeGen/X86/avx512vlvp2intersect-intrinsics.ll
b/llvm/test/CodeGen/X86/avx512vlvp2intersect-intrinsics.ll
index ef07d30299e9dad..9741972767bcdcd 100644
--- a/llvm/test/CodeGen/X86/avx512vlvp2intersect-intrinsics.ll
+++ b/llvm/test/CodeGen/X86/avx512vlvp2intersect-intrinsics.ll
@@ -84,7 +84,7 @@ define void @test_mm256_2intersect_epi32_p(ptr nocapture
readonly %a, ptr nocapt
; X86-NEXT:movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x0c]
; X86-NEXT:movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x08]
; X86-NEXT:movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x04]
-; X86-NEXT:vmovaps (%edx), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfc,0x28,0x02]
+; X86-NEXT:vmovdqa (%edx), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfd,0x6f,0x02]
; X86-NEXT:vp2intersectd (%ecx), %ymm0, %k0 # encoding:
[0x62,0xf2,0x7f,0x28,0x68,0x01]
; X86-NEXT:kmovw %k1, %ecx # encoding: [0xc5,0xf8,0x93,0xc9]
; X86-NEXT:kmovw %k0, %edx # encoding: [0xc5,0xf8,0x93,0xd0]
@@ -96,7 +96,7 @@ define void @test_mm256_2intersect_epi32_p(ptr nocapture
readonly %a, ptr nocapt
;
; X64-LABEL: test_mm256_2intersect_epi32_p:
; X64: # %bb.0: # %entry
-; X64-NEXT:vmovaps (%rdi), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfc,0x28,0x07]
+; X64-NEXT:vmovdqa (%rdi), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfd,0x6f,0x07]
; X64-NEXT:vp2intersectd (%rsi), %ymm0, %k0 # encoding:
[0x62,0xf2,0x7f,0x28,0x68,0x06]
; X64-NEXT:kmovw %k1, %eax # encoding: [0xc5,0xf8,0x93,0xc1]
; X64-NEXT:kmovw %k0, %esi # encoding: [0xc5,0xf8,0x93,0xf0]
@@ -125,7 +125,7 @@ define void @test_mm256_2intersect_epi64_p(ptr nocapture
readonly %a, ptr nocapt
; X86-NEXT:movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x10]
; X86-NEXT:movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x0c]
; X86-NEXT:movl {{[0-9]+}}(%esp), %esi # encoding: [0x8b,0x74,0x24,0x08]
-; X86-NEXT:vmovaps (%esi), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfc,0x28,0x06]
+; X86-NEXT:vmovdqa (%esi), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfd,0x6f,0x06]
; X86-NEXT:vp2intersectq (%edx), %ymm0, %k0 # encoding:
[0x62,0xf2,0xff,0x28,0x68,0x02]
; X86-NEXT:kshiftlw $12, %k0, %k2 # encoding:
[0xc4,0xe3,0xf9,0x32,0xd0,0x0c]
; X86-NEXT:kshiftrw $12, %k2, %k2 # encoding:
[0xc4,0xe3,0xf9,0x30,0xd2,0x0c]
@@ -142,7 +142,7 @@ define void @test_mm256_2intersect_epi64_p(ptr nocapture
readonly %a, ptr nocapt
;
; X64-LABEL: test_mm256_2intersect_epi64_p:
; X64: # %bb.0: # %entry
-; X64-NEXT:vmovaps (%rdi), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfc,0x28,0x07]
+; X64-NEXT:vmovdqa (%rdi), %ymm0 # EVEX TO VEX Compression encoding:
[0xc5,0xfd,0x6f,0x07]
; X64-NEXT:vp2intersectq (%rsi), %ymm0, %k0 # encoding:
[0x62,0xf2,0xff,0x28,0x68,0x06]
; X64-NEXT:kshiftlw $12, %k0, %k2 # encoding:
[0xc4,0xe3,0xf9,0x32,0xd0,0x0c]
; X64-NEXT:kshiftrw $12, %k2, %k2 # encoding:
[0xc4,0xe3,0xf9,0x30,0xd2,0x0c]
@@ -175,7 +175,7 @@ define void @test_mm256_2intersect_epi32_b(ptr nocapture
readonly %a, ptr nocapt
; X86-NEXT:movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x0c]
; X86-NEXT:movl {{[0-9]+}}(%esp), %ecx # encoding: [0x8b,0x4c,0x24,0x08]
; X86-NEXT:movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x04]
-; X86-NEXT:vbroadcastss (%edx), %ymm0 # EVEX TO VEX Compression encoding:
[0xc4,0xe2,0x7d,0x18,0x02]
+; X86-NEXT:vpbroadcastd (%edx), %ymm0 # EVEX TO VEX Compression encoding:
[0xc4,0xe2,0x7d,0x58,0x02]
; X86-NEXT:vp2intersectd (%ecx){1to8}, %ymm0, %k0 # encoding:
[0x62,0xf2,0x7f,0x38,0x68,0x01]
;