Skip to content

Commit 46d3e42

Browse files
committed
[CostModel] get type-based cost for vector intrinsics directly
This is NFC-intended (the reductions and other intrinsics have tests that should provide coverage) - trying to untangle the mess that has formed here. We were stripping the arguments off of the given "IntrinsicCostAttributes" and then semi-recursively calling back into getIntrinsicInstrCost() only to then call getTypeBasedIntrinsicInstrCost(), so make that call directly instead.
1 parent d07b290 commit 46d3e42

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
11941194
case Intrinsic::vector_reduce_umax:
11951195
case Intrinsic::vector_reduce_umin: {
11961196
IntrinsicCostAttributes Attrs(IID, RetTy, Args[0]->getType(), FMF, 1, I);
1197-
return getIntrinsicInstrCost(Attrs, CostKind);
1197+
return getTypeBasedIntrinsicInstrCost(Attrs, CostKind);
11981198
}
11991199
case Intrinsic::fshl:
12001200
case Intrinsic::fshr: {
@@ -1260,9 +1260,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
12601260
ScalarizationCost += getOperandsScalarizationOverhead(Args, VF);
12611261
}
12621262

1263-
IntrinsicCostAttributes Attrs(IID, RetTy, Types, FMF,
1264-
ScalarizationCost, I);
1265-
return thisT()->getIntrinsicInstrCost(Attrs, CostKind);
1263+
IntrinsicCostAttributes Attrs(IID, RetTy, Types, FMF, ScalarizationCost, I);
1264+
return thisT()->getTypeBasedIntrinsicInstrCost(Attrs, CostKind);
12661265
}
12671266

12681267
/// Get intrinsic cost based on argument types.

0 commit comments

Comments
 (0)