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
diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp
index b432641..1ffcc2b 100644
--- a/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -1037,8 +1037,11 @@
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 @@
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) {