mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
Use x86 specific MOVSLDUP node, add more patterns to match it and remove useless load nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112661 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0b48eade42
commit
013bb3dee9
@ -2587,6 +2587,7 @@ static bool isTargetShuffle(unsigned Opcode) {
|
|||||||
case X86ISD::MOVLHPS:
|
case X86ISD::MOVLHPS:
|
||||||
case X86ISD::MOVHLPS:
|
case X86ISD::MOVHLPS:
|
||||||
case X86ISD::MOVSHDUP:
|
case X86ISD::MOVSHDUP:
|
||||||
|
case X86ISD::MOVSLDUP:
|
||||||
case X86ISD::MOVSS:
|
case X86ISD::MOVSS:
|
||||||
case X86ISD::MOVSD:
|
case X86ISD::MOVSD:
|
||||||
case X86ISD::PUNPCKLDQ:
|
case X86ISD::PUNPCKLDQ:
|
||||||
@ -2600,6 +2601,7 @@ static SDValue getTargetShuffleNode(unsigned Opc, DebugLoc dl, EVT VT,
|
|||||||
switch(Opc) {
|
switch(Opc) {
|
||||||
default: llvm_unreachable("Unknown x86 shuffle node");
|
default: llvm_unreachable("Unknown x86 shuffle node");
|
||||||
case X86ISD::MOVSHDUP:
|
case X86ISD::MOVSHDUP:
|
||||||
|
case X86ISD::MOVSLDUP:
|
||||||
return DAG.getNode(Opc, dl, VT, V1);
|
return DAG.getNode(Opc, dl, VT, V1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5168,9 +5170,10 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
if (X86::isMOVSHDUPMask(SVOp) && HasSSE3 && V2IsUndef && NumElems == 4)
|
if (X86::isMOVSHDUPMask(SVOp) && HasSSE3 && V2IsUndef && NumElems == 4)
|
||||||
return getTargetShuffleNode(X86ISD::MOVSHDUP, dl, VT, V1, DAG);
|
return getTargetShuffleNode(X86ISD::MOVSHDUP, dl, VT, V1, DAG);
|
||||||
|
|
||||||
if (X86::isMOVSLDUPMask(SVOp) ||
|
if (X86::isMOVSLDUPMask(SVOp) && HasSSE3 && V2IsUndef && NumElems == 4)
|
||||||
X86::isMOVHLPSMask(SVOp) ||
|
return getTargetShuffleNode(X86ISD::MOVSLDUP, dl, VT, V1, DAG);
|
||||||
X86::isMOVLPMask(SVOp))
|
|
||||||
|
if (X86::isMOVLPMask(SVOp))
|
||||||
return Op;
|
return Op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,6 @@ def SDTShuff2OpI : SDTypeProfile<1, 2, [SDTCisVec<0>,
|
|||||||
def SDTShuff3OpI : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0,1>,
|
def SDTShuff3OpI : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0,1>,
|
||||||
SDTCisSameAs<0,2>, SDTCisInt<3>]>;
|
SDTCisSameAs<0,2>, SDTCisInt<3>]>;
|
||||||
|
|
||||||
def SDTShuff1OpLd : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisPtrTy<1>]>;
|
|
||||||
def SDTShuff2OpLd : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0,1>,
|
def SDTShuff2OpLd : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0,1>,
|
||||||
SDTCisPtrTy<2>]>;
|
SDTCisPtrTy<2>]>;
|
||||||
|
|
||||||
@ -157,11 +156,6 @@ def X86Movddup : SDNode<"X86ISD::MOVDDUP", SDTShuff1Op>;
|
|||||||
def X86Movshdup : SDNode<"X86ISD::MOVSHDUP", SDTShuff1Op>;
|
def X86Movshdup : SDNode<"X86ISD::MOVSHDUP", SDTShuff1Op>;
|
||||||
def X86Movsldup : SDNode<"X86ISD::MOVSLDUP", SDTShuff1Op>;
|
def X86Movsldup : SDNode<"X86ISD::MOVSLDUP", SDTShuff1Op>;
|
||||||
|
|
||||||
def X86MovshdupLd : SDNode<"X86ISD::MOVSHDUP_LD", SDTShuff1OpLd,
|
|
||||||
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
|
|
||||||
def X86MovsldupLd : SDNode<"X86ISD::MOVSLDUP_LD", SDTShuff1OpLd,
|
|
||||||
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>;
|
|
||||||
|
|
||||||
def X86Movsd : SDNode<"X86ISD::MOVSD", SDTShuff2Op>;
|
def X86Movsd : SDNode<"X86ISD::MOVSD", SDTShuff2Op>;
|
||||||
def X86Movss : SDNode<"X86ISD::MOVSS", SDTShuff2Op>;
|
def X86Movss : SDNode<"X86ISD::MOVSS", SDTShuff2Op>;
|
||||||
|
|
||||||
|
@ -5847,7 +5847,7 @@ def : Pat<(v4i32 (X86Movsd VR128:$src1, VR128:$src2)),
|
|||||||
// Shuffle with MOVSHDUP
|
// Shuffle with MOVSHDUP
|
||||||
def : Pat<(v4i32 (X86Movshdup VR128:$src)),
|
def : Pat<(v4i32 (X86Movshdup VR128:$src)),
|
||||||
(MOVSHDUPrr VR128:$src)>;
|
(MOVSHDUPrr VR128:$src)>;
|
||||||
def : Pat<(v4i32 (X86Movshdup (bc_v4i32 (memopv2i64 addr:$src)))),
|
def : Pat<(X86Movshdup (bc_v4i32 (memopv2i64 addr:$src))),
|
||||||
(MOVSHDUPrm addr:$src)>;
|
(MOVSHDUPrm addr:$src)>;
|
||||||
|
|
||||||
def : Pat<(v4f32 (X86Movshdup VR128:$src)),
|
def : Pat<(v4f32 (X86Movshdup VR128:$src)),
|
||||||
@ -5858,12 +5858,12 @@ def : Pat<(X86Movshdup (memopv4f32 addr:$src)),
|
|||||||
// Shuffle with MOVSLDUP
|
// Shuffle with MOVSLDUP
|
||||||
def : Pat<(v4i32 (X86Movsldup VR128:$src)),
|
def : Pat<(v4i32 (X86Movsldup VR128:$src)),
|
||||||
(MOVSLDUPrr VR128:$src)>;
|
(MOVSLDUPrr VR128:$src)>;
|
||||||
def : Pat<(v4i32 (X86MovsldupLd addr:$src)),
|
def : Pat<(X86Movsldup (bc_v4i32 (memopv2i64 addr:$src))),
|
||||||
(MOVSLDUPrm addr:$src)>;
|
(MOVSLDUPrm addr:$src)>;
|
||||||
|
|
||||||
def : Pat<(v4f32 (X86Movsldup VR128:$src)),
|
def : Pat<(v4f32 (X86Movsldup VR128:$src)),
|
||||||
(MOVSLDUPrr VR128:$src)>;
|
(MOVSLDUPrr VR128:$src)>;
|
||||||
def : Pat<(v4f32 (X86MovsldupLd addr:$src)),
|
def : Pat<(X86Movsldup (memopv4f32 addr:$src)),
|
||||||
(MOVSLDUPrm addr:$src)>;
|
(MOVSLDUPrm addr:$src)>;
|
||||||
|
|
||||||
// Shuffle with PSHUFHW
|
// Shuffle with PSHUFHW
|
||||||
|
Loading…
Reference in New Issue
Block a user