[llvm] [AArch64] Lower partial add reduction to udot or svdot (PR #101010)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 10:41:27 PDT 2024


================
@@ -1971,6 +1971,26 @@ bool AArch64TargetLowering::shouldExpandGetActiveLaneMask(EVT ResVT,
   return false;
 }
 
+bool AArch64TargetLowering::shouldExpandPartialReductionIntrinsic(
+    const IntrinsicInst *I) const {
+
+  VectorType *RetTy = dyn_cast<VectorType>(I->getType());
+  if (!RetTy || !RetTy->isScalableTy())
----------------
paulwalker-arm wrote:

The langref says both operands must be vectors so this can be just `cast<VectorType>` with the `!RetTy` dropped.

That said, I think you'd be better off calling `EVT::getEVT()` because then the following code can just be:
`return VT == MVT::nv4i32 || VT == MVT::nv2i64 ....`.

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


More information about the llvm-commits mailing list