summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-09-02 08:20:07 +0000
committerNadav Rotem <nrotem@apple.com>2012-09-02 08:20:07 +0000
commitf55ef64544f8ba81e50154a98f144f7b7783ed40 (patch)
treec59e7c5ee67381dd5ffec3f8cdd350c720b9e107 /lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
parentd906017c1a8b5c7c49f1bc21c13e8b85306298b8 (diff)
downloadllvm-f55ef64544f8ba81e50154a98f144f7b7783ed40.tar.gz
llvm-f55ef64544f8ba81e50154a98f144f7b7783ed40.tar.bz2
llvm-f55ef64544f8ba81e50154a98f144f7b7783ed40.tar.xz
Generate better select code by allowing the target to use scalar select, and not sign-extend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index c334f1fba5..18a71691d4 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/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);