[PATCH] D38022: [X86] Convert X86ISD::SELECT to ISD::VSELECT just before instruction selection to avoid duplicate patterns
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 22:30:03 PDT 2017
craig.topper created this revision.
Similar to what we do for X86ISD::SHRUNKBLEND just turn X86ISD::SELECT into ISD::VSELECT. This allows us to remove the duplicated TRUNC patterns.
https://reviews.llvm.org/D38022
Files:
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86InstrAVX512.td
Index: lib/Target/X86/X86InstrAVX512.td
===================================================================
--- lib/Target/X86/X86InstrAVX512.td
+++ lib/Target/X86/X86InstrAVX512.td
@@ -7564,7 +7564,7 @@
"vcvtps2ph", "$src2, $src1", "$src1, $src2",
(X86cvtps2ph (_src.VT _src.RC:$src1),
(i32 imm:$src2)),
- NoItinerary, 0, 0, X86select>, AVX512AIi8Base;
+ NoItinerary, 0, 0>, AVX512AIi8Base;
def mr : AVX512AIi8<0x1D, MRMDestMem, (outs),
(ins x86memop:$dst, _src.RC:$src1, i32u8imm:$src2),
"vcvtps2ph\t{$src2, $src1, $dst|$dst, $src1, $src2}",
@@ -8083,20 +8083,6 @@
(DestInfo.VT (OpNode (SrcInfo.VT SrcInfo.RC:$src1)))>,
EVEX, T8XS;
- // for intrinsic patter match
- def : Pat<(DestInfo.VT (X86select DestInfo.KRCWM:$mask,
- (DestInfo.VT (OpNode (SrcInfo.VT SrcInfo.RC:$src1))),
- DestInfo.ImmAllZerosV)),
- (!cast<Instruction>(NAME#SrcInfo.ZSuffix##rrkz) DestInfo.KRCWM:$mask ,
- SrcInfo.RC:$src1)>;
-
- def : Pat<(DestInfo.VT (X86select DestInfo.KRCWM:$mask,
- (DestInfo.VT (OpNode (SrcInfo.VT SrcInfo.RC:$src1))),
- DestInfo.RC:$src0)),
- (!cast<Instruction>(NAME#SrcInfo.ZSuffix##rrk) DestInfo.RC:$src0,
- DestInfo.KRCWM:$mask ,
- SrcInfo.RC:$src1)>;
-
let mayStore = 1, mayLoad = 1, hasSideEffects = 0,
ExeDomain = DestInfo.ExeDomain in {
def mr : AVX512XS8I<opc, MRMDestMem, (outs),
Index: lib/Target/X86/X86ISelDAGToDAG.cpp
===================================================================
--- lib/Target/X86/X86ISelDAGToDAG.cpp
+++ lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -2414,8 +2414,9 @@
ReplaceNode(Node, getGlobalBaseReg());
return;
+ case X86ISD::SELECT:
case X86ISD::SHRUNKBLEND: {
- // SHRUNKBLEND selects like a regular VSELECT.
+ // SHRUNKBLEND selects like a regular VSELECT. Same with X86ISD::SELECT.
SDValue VSelect = CurDAG->getNode(
ISD::VSELECT, SDLoc(Node), Node->getValueType(0), Node->getOperand(0),
Node->getOperand(1), Node->getOperand(2));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38022.115790.patch
Type: text/x-patch
Size: 2360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170919/c9536de9/attachment.bin>
More information about the llvm-commits
mailing list