forked from OSchip/llvm-project
Fix a performance regression. Use {p}shuf* when there are only two distinct elements in a build_vector.
llvm-svn: 27945
This commit is contained in:
parent
40ff2928ed
commit
16ef94f4e8
|
@ -3274,6 +3274,7 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
|||
return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V[0], V[1], ShufMask);
|
||||
}
|
||||
|
||||
if (Values.size() > 2) {
|
||||
// Expand into a number of unpckl*.
|
||||
// e.g. for v4f32
|
||||
// Step 1: unpcklps 0, 2 ==> X: <?, ?, 2, 0>
|
||||
|
@ -3291,6 +3292,9 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
|||
}
|
||||
return V[0];
|
||||
}
|
||||
|
||||
return SDOperand();
|
||||
}
|
||||
case ISD::EXTRACT_VECTOR_ELT: {
|
||||
if (!isa<ConstantSDNode>(Op.getOperand(1)))
|
||||
return SDOperand();
|
||||
|
|
Loading…
Reference in New Issue