From 86a5a7504916d7c82379aabe5f2cd86ec4dee6cd Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 17 May 2023 18:05:01 +0200 Subject: [PATCH] [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... --- llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 86ba0be..00fc8b1 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(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(FirstIE->getOperand(2))->isZero()) -- 2.7.4