forked from OSchip/llvm-project
[X86] Remove code from combineBitcastvxi1 that was needed to support the previous native IR for kunpck intrinsics.
The original autoupgrade for kunpck intrinsics used a bitcasted scalar shift, or, and. This combine would turn this into a concat_vectors. Now the kunpck intrinsics are autoupgraded to a vector shuffle that will become a concat_vectors. llvm-svn: 323504
This commit is contained in:
parent
95e8c9143e
commit
77c5077585
|
@ -30501,53 +30501,6 @@ static SDValue combineBitcastvxi1(SelectionDAG &DAG, SDValue BitCast,
|
|||
SDValue N0 = BitCast.getOperand(0);
|
||||
EVT VecVT = N0->getValueType(0);
|
||||
|
||||
if (VT.isVector() && VecVT.isScalarInteger() && Subtarget.hasAVX512() &&
|
||||
N0->getOpcode() == ISD::OR) {
|
||||
SDValue Op0 = N0->getOperand(0);
|
||||
SDValue Op1 = N0->getOperand(1);
|
||||
MVT TrunckVT;
|
||||
MVT BitcastVT;
|
||||
switch (VT.getSimpleVT().SimpleTy) {
|
||||
default:
|
||||
return SDValue();
|
||||
case MVT::v16i1:
|
||||
TrunckVT = MVT::i8;
|
||||
BitcastVT = MVT::v8i1;
|
||||
break;
|
||||
case MVT::v32i1:
|
||||
TrunckVT = MVT::i16;
|
||||
BitcastVT = MVT::v16i1;
|
||||
break;
|
||||
case MVT::v64i1:
|
||||
TrunckVT = MVT::i32;
|
||||
BitcastVT = MVT::v32i1;
|
||||
break;
|
||||
}
|
||||
bool isArg0UndefRight = Op0->getOpcode() == ISD::SHL;
|
||||
bool isArg0UndefLeft =
|
||||
Op0->getOpcode() == ISD::ZERO_EXTEND || Op0->getOpcode() == ISD::AND;
|
||||
bool isArg1UndefRight = Op1->getOpcode() == ISD::SHL;
|
||||
bool isArg1UndefLeft =
|
||||
Op1->getOpcode() == ISD::ZERO_EXTEND || Op1->getOpcode() == ISD::AND;
|
||||
SDValue OpLeft;
|
||||
SDValue OpRight;
|
||||
if (isArg0UndefRight && isArg1UndefLeft) {
|
||||
OpLeft = Op0;
|
||||
OpRight = Op1;
|
||||
} else if (isArg1UndefRight && isArg0UndefLeft) {
|
||||
OpLeft = Op1;
|
||||
OpRight = Op0;
|
||||
} else
|
||||
return SDValue();
|
||||
SDLoc DL(BitCast);
|
||||
SDValue Shr = OpLeft->getOperand(0);
|
||||
SDValue Trunc1 = DAG.getNode(ISD::TRUNCATE, DL, TrunckVT, Shr);
|
||||
SDValue Bitcast1 = DAG.getBitcast(BitcastVT, Trunc1);
|
||||
SDValue Trunc2 = DAG.getNode(ISD::TRUNCATE, DL, TrunckVT, OpRight);
|
||||
SDValue Bitcast2 = DAG.getBitcast(BitcastVT, Trunc2);
|
||||
return DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, Bitcast1, Bitcast2);
|
||||
}
|
||||
|
||||
if (!VT.isScalarInteger() || !VecVT.isSimple())
|
||||
return SDValue();
|
||||
|
||||
|
|
Loading…
Reference in New Issue