diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-05-06 02:39:09 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-05-06 02:39:09 +0000 |
commit | c70ef4e93c93eea7f1f2853df49e8f35ce71c585 (patch) | |
tree | 3adc1af31be5ba6602e0a47cb9e22310f8f2fae2 /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | |
parent | c23753a53e5f159697491075cc6bd0b872455dd7 (diff) | |
download | bcm5719-llvm-c70ef4e93c93eea7f1f2853df49e8f35ce71c585.tar.gz bcm5719-llvm-c70ef4e93c93eea7f1f2853df49e8f35ce71c585.zip |
Revert r164763 because it introduces new shuffles.
Thanks Nick Lewycky for pointing this out.
llvm-svn: 181177
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index 2defe631ae7..59502fb9880 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -974,7 +974,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { return &SI; } - if (VectorType *VecTy = dyn_cast<VectorType>(SI.getType())) { + if (VectorType* VecTy = dyn_cast<VectorType>(SI.getType())) { unsigned VWidth = VecTy->getNumElements(); APInt UndefElts(VWidth, 0); APInt AllOnesEltMask(APInt::getAllOnesValue(VWidth)); @@ -984,24 +984,6 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { return &SI; } - if (ConstantVector *CV = dyn_cast<ConstantVector>(CondVal)) { - // Form a shufflevector instruction. - SmallVector<Constant *, 8> Mask(VWidth); - Type *Int32Ty = Type::getInt32Ty(CV->getContext()); - for (unsigned i = 0; i != VWidth; ++i) { - Constant *Elem = cast<Constant>(CV->getOperand(i)); - if (ConstantInt *E = dyn_cast<ConstantInt>(Elem)) - Mask[i] = ConstantInt::get(Int32Ty, i + (E->isZero() ? VWidth : 0)); - else if (isa<UndefValue>(Elem)) - Mask[i] = UndefValue::get(Int32Ty); - else - return 0; - } - Constant *MaskVal = ConstantVector::get(Mask); - Value *V = Builder->CreateShuffleVector(TrueVal, FalseVal, MaskVal); - return ReplaceInstUsesWith(SI, V); - } - if (isa<ConstantAggregateZero>(CondVal)) { return ReplaceInstUsesWith(SI, FalseVal); } |