diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-09-02 08:20:07 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-09-02 08:20:07 +0000 |
commit | 500d691d4a4493934eaecbcb15800cbe5b89e0a5 (patch) | |
tree | bfba4a752dfd37de2dbfe314b1e4248e954c0f66 /llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | |
parent | 5a2819617a5aa4eb31cc5831e5626afef1a87152 (diff) | |
download | bcm5719-llvm-500d691d4a4493934eaecbcb15800cbe5b89e0a5.tar.gz bcm5719-llvm-500d691d4a4493934eaecbcb15800cbe5b89e0a5.zip |
Generate better select code by allowing the target to use scalar select, and not sign-extend.
llvm-svn: 163086
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index c334f1fba5f..18a71691d49 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -475,10 +475,9 @@ SDValue VectorLegalizer::ExpandSELECT(SDValue Op) { // What is the size of each element in the vector mask. EVT BitTy = MaskTy.getScalarType(); - // Turn the mask into an all-one or all-zero word. - Mask = DAG.getAnyExtOrTrunc(Mask, DL, BitTy); - Mask = DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, BitTy, Mask, - DAG.getValueType(MVT::i1)); + Mask = DAG.getNode(ISD::SELECT, DL, BitTy, Mask, + DAG.getConstant(APInt::getAllOnesValue(BitTy.getSizeInBits()), BitTy), + DAG.getConstant(3, BitTy)); // Broadcast the mask so that the entire vector is all-one or all zero. SmallVector<SDValue, 8> Ops(NumElem, Mask); |