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

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 05:26:51 PST 2026


================
@@ -1114,6 +1121,25 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
       return getCallInstrCost(nullptr, RetTy, ICA.getArgTypes(), CostKind);
     break;
   }
+  case Intrinsic::sqrt:
----------------
davemgreen wrote:

Yeah the costs could be better. IIUC the scalar cost should be 1, but it depends on the subtarget. The vector often need to execute multiple sqrts separately, and vectorizing is often still beneficial. This can be left for a bigger cleanup, my main point was about preferring not to leave bad TODOs in the code that never get cleaned up or removed.

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


More information about the llvm-commits mailing list