[PATCH] D132586: [VPlan] Move VPWidenCallRecipe to VPlanRecipes.cpp (NFC).
Ayal Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 29 00:39:58 PDT 2022
Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: pcwang-thead.
Nice cleanup! Minor nits.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4158
VPTransformState &State,
- bool UseVectorIntrinsic) {
- assert(!isa<DbgInfoIntrinsic>(CI) &&
- "DbgInfoIntrinsic should have been dropped during VPlan construction");
- State.setDebugLocFromInst(&CI);
-
- SmallVector<Type *, 4> Tys;
- for (Value *ArgOperand : CI.args())
- Tys.push_back(ToVectorTy(ArgOperand->getType(), VF.getKnownMinValue()));
-
- Intrinsic::ID ID = getVectorIntrinsicIDForCall(&CI, TLI);
-
- for (unsigned Part = 0; Part < UF; ++Part) {
- SmallVector<Type *, 2> TysForDecl = {CI.getType()};
- SmallVector<Value *, 4> Args;
- for (const auto &I : enumerate(ArgOperands.operands())) {
- // Some intrinsics have a scalar argument - don't replace it with a
- // vector.
- Value *Arg;
- if (!UseVectorIntrinsic ||
- !isVectorIntrinsicWithScalarOpAtArg(ID, I.index()))
- Arg = State.get(I.value(), Part);
- else
- Arg = State.get(I.value(), VPIteration(0, 0));
- if (isVectorIntrinsicWithOverloadTypeAtArg(ID, I.index()))
- TysForDecl.push_back(Arg->getType());
- Args.push_back(Arg);
- }
-
- Function *VectorF;
- if (UseVectorIntrinsic) {
- // 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 {
- // Use vector version of the function call.
- const VFShape Shape = VFShape::get(CI, VF, false /*HasGlobalPred*/);
-#ifndef NDEBUG
- assert(VFDatabase(CI).getVectorizedFunction(Shape) != nullptr &&
- "Can't create vector function.");
-#endif
- VectorF = VFDatabase(CI).getVectorizedFunction(Shape);
- }
- SmallVector<OperandBundleDef, 1> OpBundles;
- CI.getOperandBundlesAsDefs(OpBundles);
- CallInst *V = Builder.CreateCall(VectorF, Args, OpBundles);
-
- if (isa<FPMathOperator>(V))
- V->copyFastMathFlags(&CI);
-
- State.set(Def, V, Part);
- State.addMetadata(V, &CI);
- }
-}
+ bool UseVectorIntrinsic) {}
----------------
Remove useless method altogether?
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:352
+ /// Hold a reference to TargetLibrarInfo.
+ const TargetLibraryInfo &TLI;
----------------
typo
================
Comment at: llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp:448
+
+ Intrinsic::ID ID = getVectorIntrinsicIDForCall(&CI, &State.TLI);
+
----------------
Store ID in call recipe instead of dragging TLI around in State?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132586/new/
https://reviews.llvm.org/D132586
More information about the llvm-commits
mailing list