1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[AVX512] Add a couple patterns to fix some cases where two vector mask inversions could appear in a row.

llvm-svn: 270344
This commit is contained in:
Craig Topper 2016-05-22 00:39:30 +00:00
parent 0754f22fa5
commit a6980162a3
2 changed files with 15 additions and 12 deletions

View File

@ -2761,6 +2761,17 @@ def : Pat<(v16i32 (vselect VK16WM:$mask, (v16i32 immAllZerosV),
(v16i32 VR512:$src))),
(VMOVDQA32Zrrkz (KNOTWrr VK16WM:$mask), VR512:$src)>;
// These patterns exist to prevent the above patterns from introducing a second
// mask inversion when one already exists.
def : Pat<(v8i64 (vselect (xor VK8:$mask, (v8i1 immAllOnesV)),
(bc_v8i64 (v16i32 immAllZerosV)),
(v8i64 VR512:$src))),
(VMOVDQA64Zrrkz VK8:$mask, VR512:$src)>;
def : Pat<(v16i32 (vselect (xor VK16:$mask, (v16i1 immAllOnesV)),
(v16i32 immAllZerosV),
(v16i32 VR512:$src))),
(VMOVDQA32Zrrkz VK16WM:$mask, VR512:$src)>;
// Move Int Doubleword to Packed Double Int
//
def VMOVDI2PDIZrr : AVX512BI<0x6E, MRMSrcReg, (outs VR128X:$dst), (ins GR32:$src),

View File

@ -279,18 +279,14 @@ define <16 x i32> @test14(<16 x i32>%a, <16 x i32>%b) {
; KNL-LABEL: test14:
; KNL: ## BB#0:
; KNL-NEXT: vpsubd %zmm1, %zmm0, %zmm1
; KNL-NEXT: vpcmpgtd %zmm0, %zmm1, %k0
; KNL-NEXT: knotw %k0, %k0
; KNL-NEXT: knotw %k0, %k1
; KNL-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
; KNL-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
; KNL-NEXT: retq
;
; SKX-LABEL: test14:
; SKX: ## BB#0:
; SKX-NEXT: vpsubd %zmm1, %zmm0, %zmm1
; SKX-NEXT: vpcmpgtd %zmm0, %zmm1, %k0
; SKX-NEXT: knotw %k0, %k0
; SKX-NEXT: knotw %k0, %k1
; SKX-NEXT: vpcmpgtd %zmm0, %zmm1, %k1
; SKX-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1} {z}
; SKX-NEXT: retq
%sub_r = sub <16 x i32> %a, %b
@ -305,18 +301,14 @@ define <8 x i64> @test15(<8 x i64>%a, <8 x i64>%b) {
; KNL-LABEL: test15:
; KNL: ## BB#0:
; KNL-NEXT: vpsubq %zmm1, %zmm0, %zmm1
; KNL-NEXT: vpcmpgtq %zmm0, %zmm1, %k0
; KNL-NEXT: knotw %k0, %k0
; KNL-NEXT: knotw %k0, %k1
; KNL-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
; KNL-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; KNL-NEXT: retq
;
; SKX-LABEL: test15:
; SKX: ## BB#0:
; SKX-NEXT: vpsubq %zmm1, %zmm0, %zmm1
; SKX-NEXT: vpcmpgtq %zmm0, %zmm1, %k0
; SKX-NEXT: knotb %k0, %k0
; SKX-NEXT: knotw %k0, %k1
; SKX-NEXT: vpcmpgtq %zmm0, %zmm1, %k1
; SKX-NEXT: vmovdqa64 %zmm1, %zmm0 {%k1} {z}
; SKX-NEXT: retq
%sub_r = sub <8 x i64> %a, %b