aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Constants.cpp4
-rw-r--r--llvm/lib/IR/IRBuilder.cpp4
2 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index f777b1b..a536711 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -1415,11 +1415,11 @@ Constant *ConstantVector::getSplat(ElementCount EC, Constant *V) {
else if (isa<UndefValue>(V))
return UndefValue::get(VTy);
- Type *I32Ty = Type::getInt32Ty(VTy->getContext());
+ Type *IdxTy = Type::getInt64Ty(VTy->getContext());
// Move scalar into vector.
Constant *PoisonV = PoisonValue::get(VTy);
- V = ConstantExpr::getInsertElement(PoisonV, V, ConstantInt::get(I32Ty, 0));
+ V = ConstantExpr::getInsertElement(PoisonV, V, ConstantInt::get(IdxTy, 0));
// Build shuffle mask to perform the splat.
SmallVector<int, 8> Zeros(EC.getKnownMinValue(), 0);
// Splat.
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp
index c4923bc..f871205 100644
--- a/llvm/lib/IR/IRBuilder.cpp
+++ b/llvm/lib/IR/IRBuilder.cpp
@@ -1257,10 +1257,8 @@ Value *IRBuilderBase::CreateVectorSplat(ElementCount EC, Value *V,
assert(EC.isNonZero() && "Cannot splat to an empty vector!");
// First insert it into a poison vector so we can shuffle it.
- Type *I32Ty = getInt32Ty();
Value *Poison = PoisonValue::get(VectorType::get(V->getType(), EC));
- V = CreateInsertElement(Poison, V, ConstantInt::get(I32Ty, 0),
- Name + ".splatinsert");
+ V = CreateInsertElement(Poison, V, getInt64(0), Name + ".splatinsert");
// Shuffle the value across the desired number of elements.
SmallVector<int, 16> Zeros;