[llvm] [LV][EVL] Support call instruction with EVL-vectorization (PR #110412)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 20:47:13 PDT 2024
================
@@ -1023,6 +1038,18 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
// clear Arguments.
// TODO: Rework TTI interface to be independent of concrete IR values.
SmallVector<const Value *> Arguments;
+
+ Intrinsic::ID FID = VectorIntrinsicID;
+ unsigned NumOperands = getNumOperands();
+ if (VPIntrinsic::isVPIntrinsic(VectorIntrinsicID)) {
+ std::optional<Intrinsic::ID> ID =
+ VPIntrinsic::getFunctionalIntrinsicIDForVP(VectorIntrinsicID);
+ if (ID) {
+ FID = ID.value();
----------------
LiqinWeng wrote:
1. After the VP instruction adds the EVL parameter through the VPTransform process, Arguments will be cleared and will fall Into BasicTTIImpl, which will check if the VP intrinsic is a type based instruction. All type based instruction will fall into the getTypeBasedIntrinsicInstrCost
2. VP Intrinsics should have the same cost as their non-vp counterpart
3. To ensure the accuracy of the CostAttrs parameters passed to TTI, such as the number of parameters, parameter type, ID, etc.
https://github.com/llvm/llvm-project/pull/110412
More information about the llvm-commits
mailing list