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 | 4ee312bac138a18c39353d4736eb5921532f9624 (patch) | |
tree | 8bca6791c6b31accb25362ae9e75acc09e29245e /lib | |
parent | 8b9dc21d6f12a0251cdb6116c2297c13d77073d5 (diff) | |
download | external_llvm-4ee312bac138a18c39353d4736eb5921532f9624.zip external_llvm-4ee312bac138a18c39353d4736eb5921532f9624.tar.gz external_llvm-4ee312bac138a18c39353d4736eb5921532f9624.tar.bz2 |
Revert r164763 because it introduces new shuffles.
Thanks Nick Lewycky for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineSelect.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineSelect.cpp b/lib/Transforms/InstCombine/InstCombineSelect.cpp index 2defe63..59502fb 100644 --- a/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/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); } |