From 1c920918395e182352269578542f3c295baf81f9 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 17 Aug 2017 23:20:57 +0000 Subject: [PATCH] [X86] Remove SSE/AVX patterns for AND/XOR/OR/ANDN that checked for the inputs being bitcasted from floating point types. There's really no reason to do this we should just let isel pick the integer version and let the execution dependency fixing pass take care of moving to FP if necessary. It's not very reliable to look for bitcasts at the edges of patterns. If for some reason one input was bitcasted and the other wasn't, or if one was a v4f32 bitcast and one was a v2f64 bitcast, we would have fallen back to the integer pattern anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311138 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 35 +++++++++-------------------------- test/CodeGen/X86/cast-vsel.ll | 2 +- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 60cd226bd21..6ac7ae67220 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -310,6 +310,7 @@ multiclass sse12_fp_packed_logical_rm opc, RegisterClass RC, Domain d, !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1, $src2}")), pat_rr, IIC_SSE_BIT_P_RR, d>, Sched<[WriteVecLogic]>; + let hasSideEffects = 0, mayLoad = 1 in def rm : PI opc, string OpcodeStr, SDNode OpNode> { let Predicates = [HasAVX, NoVLX] in { defm V#NAME#PSY : sse12_fp_packed_logical_rm, PS, VEX_4V, VEX_L, VEX_WIG; + [], [], 0>, PS, VEX_4V, VEX_L, VEX_WIG; defm V#NAME#PDY : sse12_fp_packed_logical_rm, - PD, VEX_4V, VEX_L, VEX_WIG; + [], [], 0>, PD, VEX_4V, VEX_L, VEX_WIG; defm V#NAME#PS : sse12_fp_packed_logical_rm, PS, VEX_4V, VEX_WIG; + [], [], 0>, PS, VEX_4V, VEX_WIG; defm V#NAME#PD : sse12_fp_packed_logical_rm, - PD, VEX_4V, VEX_WIG; + [], [], 0>, PD, VEX_4V, VEX_WIG; } let Constraints = "$src1 = $dst" in { defm PS : sse12_fp_packed_logical_rm, PS; + [], []>, PS; defm PD : sse12_fp_packed_logical_rm, PD; + [], []>, PD; } } diff --git a/test/CodeGen/X86/cast-vsel.ll b/test/CodeGen/X86/cast-vsel.ll index 260535985e2..751320e7259 100644 --- a/test/CodeGen/X86/cast-vsel.ll +++ b/test/CodeGen/X86/cast-vsel.ll @@ -411,8 +411,8 @@ define void @example25() nounwind { ; AVX2-NEXT: vcmpltps db+4096(%rax), %ymm1, %ymm1 ; AVX2-NEXT: vmovups dc+4096(%rax), %ymm2 ; AVX2-NEXT: vcmpltps dd+4096(%rax), %ymm2, %ymm2 +; AVX2-NEXT: vandps %ymm0, %ymm2, %ymm2 ; AVX2-NEXT: vandps %ymm2, %ymm1, %ymm1 -; AVX2-NEXT: vandps %ymm0, %ymm1, %ymm1 ; AVX2-NEXT: vmovups %ymm1, dj+4096(%rax) ; AVX2-NEXT: addq $32, %rax ; AVX2-NEXT: jne .LBB5_1 -- 2.11.0