[LV] Sink module variable and use State to set it in widenCall. (NFC)

Limits the lifetime of the variable and makes it independent of
CallInst.
This commit is contained in:
Florian Hahn 2022-07-18 19:41:48 +01:00
parent dbed4326dd
commit 30e53b8c03
No known key found for this signature in database
GPG Key ID: EEF712BB5E80EBBA
1 changed files with 1 additions and 1 deletions

View File

@ -4202,7 +4202,6 @@ void InnerLoopVectorizer::widenCallInstruction(CallInst &I, VPValue *Def,
"DbgInfoIntrinsic should have been dropped during VPlan construction");
State.setDebugLocFromInst(&I);
Module *M = I.getParent()->getParent()->getParent();
auto *CI = cast<CallInst>(&I);
SmallVector<Type *, 4> Tys;
@ -4245,6 +4244,7 @@ void InnerLoopVectorizer::widenCallInstruction(CallInst &I, VPValue *Def,
// Use vector version of the intrinsic.
if (VF.isVector())
TysForDecl[0] = VectorType::get(CI->getType()->getScalarType(), VF);
Module *M = State.Builder.GetInsertBlock()->getModule();
VectorF = Intrinsic::getDeclaration(M, ID, TysForDecl);
assert(VectorF && "Can't retrieve vector intrinsic.");
} else {