Skip to content

Commit f5e5d86

Browse files
committed
add the some comments
1 parent adfd48a commit f5e5d86

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,15 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
997997
// TODO: Rework TTI interface to be independent of concrete IR values.
998998
SmallVector<const Value *> Arguments;
999999

1000-
// VP Intrinsics should have the same cost as their non-vp counterpart.
1000+
// In fact, we need to get the VP intrinsics cost from the TTI, but currently
1001+
// the legacy model, it will always calculate cost of the call Intrinsics, eg:
1002+
// llvm.ctlz/llvm.smax, so VP Intrinsics should have the same cost as their
1003+
// non-vp counterpart.
1004+
// TODO: Use VP intrinsics to calculate the cost, if the following conditions
1005+
// are met
1006+
// 1. We don't need to compare to the legacy cost model
1007+
// 2. The cost model of VP is gradually improved in TTI
1008+
// 3. VPlan can set accurate CostAttrs’s parameters
10011009
Intrinsic::ID FID = VectorIntrinsicID;
10021010
unsigned NumOperands = getNumOperands();
10031011
const_operand_range arg_operands =
@@ -1008,7 +1016,7 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
10081016
if (ID) {
10091017
FID = ID.value();
10101018
NumOperands = getNumOperands() - 1;
1011-
// Remove the EVL
1019+
// Remove the EVL from arg_operands
10121020
arg_operands = make_range(op_begin(), op_begin() + getNumOperands() - 1);
10131021
}
10141022
}

0 commit comments

Comments
 (0)