[llvm] [AArch64] Fix SVE cost model for various math intrinsics (PR #184358)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 04:50:06 PST 2026


================
@@ -696,6 +696,13 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     break;
   }
   case Intrinsic::abs: {
+    if (isa<ScalableVectorType>(RetTy) && ST->isSVEorStreamingSVEAvailable()) {
+      auto LT = getTypeLegalizationCost(RetTy);
----------------
paulwalker-arm wrote:

Oh, I see what I've misunderstood now.  We're relying on the cost of the "legal operation" being one and thus bypassing the maths to include that cost, which works for the split case but not when promoting.

https://github.com/llvm/llvm-project/pull/184358


More information about the llvm-commits mailing list