aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineCasts.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-14 18:15:46 +0000
committerChris Lattner <sabre@nondot.org>2011-02-14 18:15:46 +0000
commit75831904220042260c4faece8507a2807acba47f (patch)
tree69d0fd5dfad613c79932f7f5c53e2e61a2616cf3 /lib/Transforms/InstCombine/InstCombineCasts.cpp
parent50a47e93cebdf22dacb95a6e75a5b803fc4c3e04 (diff)
revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCasts.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp
index b432641a14..1ffcc2b122 100644
--- a/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -1037,8 +1037,11 @@ Instruction *InstCombiner::visitSExt(SExtInst &CI) {
if (Pred == ICmpInst::ICMP_SLT && CmpLHS->getType() == DestTy) {
const Type *EltTy = VTy->getElementType();
- // splat the shift constant to a constant vector.
- Constant *VSh = ConstantInt::get(VTy, EltTy->getScalarSizeInBits()-1);
+ // splat the shift constant to a cosntant vector
+ Constant *Sh = ConstantInt::get(EltTy, EltTy->getScalarSizeInBits()-1);
+ std::vector<Constant *> Elts(VTy->getNumElements(), Sh);
+ Constant *VSh = ConstantVector::get(Elts);
+
Value *In = Builder->CreateAShr(CmpLHS, VSh,CmpLHS->getName()+".lobit");
return ReplaceInstUsesWith(CI, In);
}
@@ -1387,7 +1390,8 @@ static Instruction *OptimizeVectorResize(Value *InVal, const VectorType *DestTy,
ConstantInt::get(Int32Ty, SrcElts));
}
- return new ShuffleVectorInst(InVal, V2, ConstantVector::get(ShuffleMask));
+ Constant *Mask = ConstantVector::get(ShuffleMask.data(), ShuffleMask.size());
+ return new ShuffleVectorInst(InVal, V2, Mask);
}
static bool isMultipleOfTypeSize(unsigned Value, const Type *Ty) {