File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -997,7 +997,15 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
997
997
// TODO: Rework TTI interface to be independent of concrete IR values.
998
998
SmallVector<const Value *> Arguments;
999
999
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
1001
1009
Intrinsic::ID FID = VectorIntrinsicID;
1002
1010
unsigned NumOperands = getNumOperands ();
1003
1011
const_operand_range arg_operands =
@@ -1008,7 +1016,7 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
1008
1016
if (ID) {
1009
1017
FID = ID.value ();
1010
1018
NumOperands = getNumOperands () - 1 ;
1011
- // Remove the EVL
1019
+ // Remove the EVL from arg_operands
1012
1020
arg_operands = make_range (op_begin (), op_begin () + getNumOperands () - 1 );
1013
1021
}
1014
1022
}
You can’t perform that action at this time.
0 commit comments