Skip to content

Commit e9389b1

Browse files
committed
add the some comments
1 parent 6212dad commit e9389b1

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
@@ -1000,7 +1000,15 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
10001000
// TODO: Rework TTI interface to be independent of concrete IR values.
10011001
SmallVector<const Value *> Arguments;
10021002

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

0 commit comments

Comments
 (0)