Skip to content

Commit 9eb3aee

Browse files
authored
[CostModel][AArch64] Model cost of extract.last.active intrinsic (clastb) (#165739)
Adds some aarch64 cost model tests for extract.last.active, and produces a lower cost when SVE is available (expecting clastb to be generated).
1 parent c8e2f43 commit 9eb3aee

File tree

2 files changed

+223
-0
lines changed

2 files changed

+223
-0
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,13 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
10321032
}
10331033
break;
10341034
}
1035+
case Intrinsic::experimental_vector_extract_last_active:
1036+
if (ST->isSVEorStreamingSVEAvailable()) {
1037+
auto [LegalCost, _] = getTypeLegalizationCost(ICA.getArgTypes()[0]);
1038+
// This should turn into chained clastb instructions.
1039+
return LegalCost;
1040+
}
1041+
break;
10351042
default:
10361043
break;
10371044
}

0 commit comments

Comments
 (0)