[PATCH] D38649: [PATCH][AVX512] Fix TERNLOG when folding broadcast
Cameron McInally via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 6 15:19:00 PDT 2017
cameron.mcinally created this revision.
Here's a little patch to fix ternlog instructions with a folded
broadcast. The broadcast decorator, e.g. {1toX}, was missing.
https://reviews.llvm.org/D38649
Files:
lib/Target/X86/X86InstrAVX512.td
test/CodeGen/X86/avx512-vpternlog-commute.ll
Index: test/CodeGen/X86/avx512-vpternlog-commute.ll
===================================================================
--- test/CodeGen/X86/avx512-vpternlog-commute.ll
+++ test/CodeGen/X86/avx512-vpternlog-commute.ll
@@ -1008,7 +1008,7 @@
; CHECK-LABEL: vpternlog_v16i32_012_broadcast0_mask1:
; CHECK: ## BB#0:
; CHECK-NEXT: kmovd %esi, %k1
-; CHECK-NEXT: vpternlogd $92, (%rdi), %zmm1, %zmm0 {%k1}
+; CHECK-NEXT: vpternlogd $92, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
; CHECK-NEXT: retq
%x0scalar = load i32, i32* %x0ptr
%vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
@@ -1023,7 +1023,7 @@
; CHECK-LABEL: vpternlog_v16i32_012_broadcast0_mask2:
; CHECK: ## BB#0:
; CHECK-NEXT: kmovd %esi, %k1
-; CHECK-NEXT: vpternlogd $58, (%rdi), %zmm0, %zmm1 {%k1}
+; CHECK-NEXT: vpternlogd $58, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
; CHECK-NEXT: retq
%x0scalar = load i32, i32* %x0ptr
@@ -1039,7 +1039,7 @@
; CHECK-LABEL: vpternlog_v16i32_012_broadcast1_mask2:
; CHECK: ## BB#0:
; CHECK-NEXT: kmovd %esi, %k1
-; CHECK-NEXT: vpternlogd $46, (%rdi), %zmm0, %zmm1 {%k1}
+; CHECK-NEXT: vpternlogd $46, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
; CHECK-NEXT: retq
%x1scalar = load i32, i32* %x1ptr
@@ -1055,7 +1055,7 @@
; CHECK-LABEL: vpternlog_v16i32_012_broadcast2_mask1:
; CHECK: ## BB#0:
; CHECK-NEXT: kmovd %esi, %k1
-; CHECK-NEXT: vpternlogd $78, (%rdi), %zmm0, %zmm1 {%k1}
+; CHECK-NEXT: vpternlogd $78, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
; CHECK-NEXT: retq
%x2scalar = load i32, i32* %x2ptr
Index: lib/Target/X86/X86InstrAVX512.td
===================================================================
--- lib/Target/X86/X86InstrAVX512.td
+++ lib/Target/X86/X86InstrAVX512.td
@@ -9399,26 +9399,26 @@
(OpNode (X86VBroadcast (_.ScalarLdFrag addr:$src3)),
_.RC:$src2, _.RC:$src1, (i8 imm:$src4)),
_.RC:$src1)),
- (!cast<Instruction>(NAME#_.ZSuffix#rmik) _.RC:$src1, _.KRCWM:$mask,
+ (!cast<Instruction>(NAME#_.ZSuffix#rmbik) _.RC:$src1, _.KRCWM:$mask,
_.RC:$src2, addr:$src3, (VPTERNLOG321_imm8 imm:$src4))>;
def : Pat<(_.VT (vselect _.KRCWM:$mask,
(OpNode _.RC:$src2, _.RC:$src1,
(X86VBroadcast (_.ScalarLdFrag addr:$src3)),
(i8 imm:$src4)), _.RC:$src1)),
- (!cast<Instruction>(NAME#_.ZSuffix#rmik) _.RC:$src1, _.KRCWM:$mask,
+ (!cast<Instruction>(NAME#_.ZSuffix#rmbik) _.RC:$src1, _.KRCWM:$mask,
_.RC:$src2, addr:$src3, (VPTERNLOG213_imm8 imm:$src4))>;
def : Pat<(_.VT (vselect _.KRCWM:$mask,
(OpNode _.RC:$src2,
(X86VBroadcast (_.ScalarLdFrag addr:$src3)),
_.RC:$src1, (i8 imm:$src4)),
_.RC:$src1)),
- (!cast<Instruction>(NAME#_.ZSuffix#rmik) _.RC:$src1, _.KRCWM:$mask,
+ (!cast<Instruction>(NAME#_.ZSuffix#rmbik) _.RC:$src1, _.KRCWM:$mask,
_.RC:$src2, addr:$src3, (VPTERNLOG231_imm8 imm:$src4))>;
def : Pat<(_.VT (vselect _.KRCWM:$mask,
(OpNode (X86VBroadcast (_.ScalarLdFrag addr:$src3)),
_.RC:$src1, _.RC:$src2, (i8 imm:$src4)),
_.RC:$src1)),
- (!cast<Instruction>(NAME#_.ZSuffix#rmik) _.RC:$src1, _.KRCWM:$mask,
+ (!cast<Instruction>(NAME#_.ZSuffix#rmbik) _.RC:$src1, _.KRCWM:$mask,
_.RC:$src2, addr:$src3, (VPTERNLOG312_imm8 imm:$src4))>;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38649.118094.patch
Type: text/x-patch
Size: 3684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171006/bc068000/attachment.bin>
More information about the llvm-commits
mailing list