1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[X86][SSE] Dropped blend(insertps(x,y),zero) combine - this is now handled by target shuffle chain combining

llvm-svn: 278260
This commit is contained in:
Simon Pilgrim 2016-08-10 18:10:29 +00:00
parent 6514f5cdd0
commit 2ca47e753e

View File

@ -25959,44 +25959,6 @@ static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG,
return DAG.getNode(X86ISD::BLENDI, DL, VT, V1, V0, NewMask);
}
// Attempt to merge blend(insertps(x,y),zero).
if (V0.getOpcode() == X86ISD::INSERTPS ||
V1.getOpcode() == X86ISD::INSERTPS) {
assert(VT == MVT::v4f32 && "INSERTPS ValueType must be MVT::v4f32");
// Determine which elements are known to be zero.
SmallVector<int, 8> TargetMask;
SmallVector<SDValue, 2> BlendOps;
if (!setTargetShuffleZeroElements(N, TargetMask, BlendOps))
return SDValue();
// Helper function to take inner insertps node and attempt to
// merge the blend with zero into its zero mask.
auto MergeInsertPSAndBlend = [&](SDValue V, int Offset) {
if (V.getOpcode() != X86ISD::INSERTPS)
return SDValue();
SDValue Op0 = V.getOperand(0);
SDValue Op1 = V.getOperand(1);
SDValue Op2 = V.getOperand(2);
unsigned InsertPSMask = cast<ConstantSDNode>(Op2)->getZExtValue();
// Check each element of the blend node's target mask - must either
// be zeroable (and update the zero mask) or selects the element from
// the inner insertps node.
for (int i = 0; i != 4; ++i)
if (TargetMask[i] < 0)
InsertPSMask |= (1u << i);
else if (TargetMask[i] != (i + Offset))
return SDValue();
return DAG.getNode(X86ISD::INSERTPS, DL, MVT::v4f32, Op0, Op1,
DAG.getConstant(InsertPSMask, DL, MVT::i8));
};
if (SDValue V = MergeInsertPSAndBlend(V0, 0))
return V;
if (SDValue V = MergeInsertPSAndBlend(V1, 4))
return V;
}
return SDValue();
}
case X86ISD::INSERTPS: {