summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-05-17 18:05:01 +0200
committerNikita Popov <npopov@redhat.com>2023-05-17 18:06:08 +0200
commit86a5a7504916d7c82379aabe5f2cd86ec4dee6cd (patch)
tree6b7095903c4af4f6aef33a5cf3ef12fadc564ef2
parente000b62a342cac907fd77cfdd070f0b055f0c3c4 (diff)
downloadllvm-86a5a7504916d7c82379aabe5f2cd86ec4dee6cd.tar.gz
[InstCombine] Use canonical index type in more places
Also fixes an issue with 80cd3e4e2059f8deda735c32bf7dfa5b9d75c4e0 pointed out by Roman Divacky: For one of the occurrences I only changed the name of the type variable, without actually changing the type...
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 86ba0be5d8f7..00fc8b1c03b5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -550,9 +550,9 @@ Instruction *InstCombinerImpl::visitExtractElementInst(ExtractElementInst &EI) {
SrcIdx -= LHSWidth;
Src = SVI->getOperand(1);
}
- Type *Int32Ty = Type::getInt32Ty(EI.getContext());
+ Type *Int64Ty = Type::getInt64Ty(EI.getContext());
return ExtractElementInst::Create(
- Src, ConstantInt::get(Int32Ty, SrcIdx, false));
+ Src, ConstantInt::get(Int64Ty, SrcIdx, false));
}
} else if (auto *CI = dyn_cast<CastInst>(I)) {
// Canonicalize extractelement(cast) -> cast(extractelement).
@@ -1250,7 +1250,7 @@ static Instruction *foldInsSequenceIntoSplat(InsertElementInst &InsElt) {
return nullptr;
// Create the insert + shuffle.
- Type *Int64Ty = Type::getInt32Ty(InsElt.getContext());
+ Type *Int64Ty = Type::getInt64Ty(InsElt.getContext());
PoisonValue *PoisonVec = PoisonValue::get(VecTy);
Constant *Zero = ConstantInt::get(Int64Ty, 0);
if (!cast<ConstantInt>(FirstIE->getOperand(2))->isZero())