From ecf7c5b75f13ba523ac5361b295bb906da31285c Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 25 Jun 2018 00:05:09 +0000 Subject: [PATCH] [X86] Reduce the number of patterns needed for masked scalar ceil/floor isel. The scalar to vector on the mask register should not be part of the patterns. llvm-svn: 335435 --- llvm/lib/Target/X86/X86InstrAVX512.td | 45 ++++++--------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td b/llvm/lib/Target/X86/X86InstrAVX512.td index 55b1a3aa0fdb..b93b095af0f9 100644 --- a/llvm/lib/Target/X86/X86InstrAVX512.td +++ b/llvm/lib/Target/X86/X86InstrAVX512.td @@ -8859,55 +8859,30 @@ defm : avx512_masked_scalar; multiclass avx512_masked_scalar_imm ImmV, dag OutMask, - Predicate BasePredicate> { + X86VectorVTInfo _, PatLeaf ZeroFP, + bits<8> ImmV, Predicate BasePredicate> { let Predicates = [BasePredicate] in { - def : Pat<(Move _.VT:$src1, (scalar_to_vector (X86selects Mask, + def : Pat<(Move _.VT:$src1, (scalar_to_vector (X86selects VK1WM:$mask, (OpNode (extractelt _.VT:$src2, (iPTR 0))), (extractelt _.VT:$dst, (iPTR 0))))), (!cast("V"#OpcPrefix#Zr_Intk) - _.VT:$dst, OutMask, _.VT:$src1, _.VT:$src2, (i32 ImmV))>; + _.VT:$dst, VK1WM:$mask, _.VT:$src1, _.VT:$src2, (i32 ImmV))>; - def : Pat<(Move _.VT:$src1, (scalar_to_vector (X86selects Mask, + def : Pat<(Move _.VT:$src1, (scalar_to_vector (X86selects VK1WM:$mask, (OpNode (extractelt _.VT:$src2, (iPTR 0))), ZeroFP))), (!cast("V"#OpcPrefix#Zr_Intkz) - OutMask, _.VT:$src1, _.VT:$src2, (i32 ImmV))>; + VK1WM:$mask, _.VT:$src1, _.VT:$src2, (i32 ImmV))>; } } defm : avx512_masked_scalar_imm; -defm : avx512_masked_scalar_imm; + v4f32x_info, fp32imm0, 0x01, HasAVX512>; defm : avx512_masked_scalar_imm; -defm : avx512_masked_scalar_imm; + v4f32x_info, fp32imm0, 0x02, HasAVX512>; defm : avx512_masked_scalar_imm; -defm : avx512_masked_scalar_imm; + v2f64x_info, fp64imm0, 0x01, HasAVX512>; defm : avx512_masked_scalar_imm; -defm : avx512_masked_scalar_imm; + v2f64x_info, fp64imm0, 0x02, HasAVX512>; //-------------------------------------------------