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 @@ -1034,7 +1034,15 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
1034
1034
// TODO: Rework TTI interface to be independent of concrete IR values.
1035
1035
SmallVector<const Value *> Arguments;
1036
1036
1037
- // VP Intrinsics should have the same cost as their non-vp counterpart.
1037
+ // In fact, we need to get the VP intrinsics cost from the TTI, but currently
1038
+ // the legacy model, it will always calculate cost of the call Intrinsics, eg:
1039
+ // llvm.ctlz/llvm.smax, so VP Intrinsics should have the same cost as their
1040
+ // non-vp counterpart.
1041
+ // TODO: Use VP intrinsics to calculate the cost, if the following conditions
1042
+ // are met
1043
+ // 1. We don't need to compare to the legacy cost model
1044
+ // 2. The cost model of VP is gradually improved in TTI
1045
+ // 3. VPlan can set accurate CostAttrs’s parameters
1038
1046
Intrinsic::ID FID = VectorIntrinsicID;
1039
1047
unsigned NumOperands = getNumOperands ();
1040
1048
const_operand_range arg_operands =
@@ -1045,7 +1053,7 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
1045
1053
if (ID) {
1046
1054
FID = ID.value ();
1047
1055
NumOperands = getNumOperands () - 1 ;
1048
- // Remove the EVL
1056
+ // Remove the EVL from arg_operands
1049
1057
arg_operands = make_range (op_begin (), op_begin () + getNumOperands () - 1 );
1050
1058
}
1051
1059
}
You can’t perform that action at this time.
0 commit comments