mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 13:21:43 +00:00
Use a legal integer type for vector shuffle mask
elements. Otherwise LegalizeTypes will, reasonably enough, legalize the mask, which may result in it no longer being a BUILD_VECTOR node (LegalizeDAG simply ignores the legality or not of vector masks). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2a0b96c2c7
commit
94989acaab
@ -5134,24 +5134,24 @@ SDValue DAGCombiner::XformToShuffleWithZero(SDNode *N) {
|
||||
std::vector<SDValue> IdxOps;
|
||||
unsigned NumOps = RHS.getNumOperands();
|
||||
unsigned NumElts = NumOps;
|
||||
MVT EVT = RHS.getValueType().getVectorElementType();
|
||||
for (unsigned i = 0; i != NumElts; ++i) {
|
||||
SDValue Elt = RHS.getOperand(i);
|
||||
if (!isa<ConstantSDNode>(Elt))
|
||||
return SDValue();
|
||||
else if (cast<ConstantSDNode>(Elt)->isAllOnesValue())
|
||||
IdxOps.push_back(DAG.getConstant(i, EVT));
|
||||
IdxOps.push_back(DAG.getIntPtrConstant(i));
|
||||
else if (cast<ConstantSDNode>(Elt)->isNullValue())
|
||||
IdxOps.push_back(DAG.getConstant(NumElts, EVT));
|
||||
IdxOps.push_back(DAG.getIntPtrConstant(NumElts));
|
||||
else
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
// Let's see if the target supports this vector_shuffle.
|
||||
if (!TLI.isVectorClearMaskLegal(IdxOps, EVT, DAG))
|
||||
if (!TLI.isVectorClearMaskLegal(IdxOps, TLI.getPointerTy(), DAG))
|
||||
return SDValue();
|
||||
|
||||
// Return the new VECTOR_SHUFFLE node.
|
||||
MVT EVT = RHS.getValueType().getVectorElementType();
|
||||
MVT VT = MVT::getVectorVT(EVT, NumElts);
|
||||
std::vector<SDValue> Ops;
|
||||
LHS = DAG.getNode(ISD::BIT_CONVERT, VT, LHS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user