[llvm-branch-commits] [llvm] AMDGPU: Report special input intrinsics as free (PR #141948)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 29 12:57:33 PDT 2025
================
@@ -704,8 +704,29 @@ static bool intrinsicHasPackedVectorBenefit(Intrinsic::ID ID) {
InstructionCost
GCNTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
TTI::TargetCostKind CostKind) const {
- if (ICA.getID() == Intrinsic::fabs)
+ switch (ICA.getID()) {
+ case Intrinsic::fabs:
+ // Free source modifier in the common case.
+ return 0;
+ case Intrinsic::amdgcn_workitem_id_x:
+ case Intrinsic::amdgcn_workitem_id_y:
+ case Intrinsic::amdgcn_workitem_id_z:
+ // TODO: If hasPackedTID, or if the calling context is not an entry point
----------------
arsenm wrote:
For some reason the calling instruction isn't set in the context where this gets called from, so I can't figure out if it's a kernel or not so I left this for later
https://github.com/llvm/llvm-project/pull/141948
More information about the llvm-branch-commits
mailing list