[llvm] [LV][AArch64] Provide option to use partial reductions by default (PR #216001)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 06:18:08 PDT 2026


================
@@ -6684,10 +6684,30 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
     return Invalid;
 
   if ((Opcode != Instruction::Add && Opcode != Instruction::Sub &&
-       Opcode != Instruction::FAdd && Opcode != Instruction::FSub) ||
-      OpAExtend == TTI::PR_None)
+       Opcode != Instruction::FAdd && Opcode != Instruction::FSub))
     return Invalid;
 
+  // We don't support 128b or higher element types.
+  if (InputTypeA->getScalarSizeInBits() > 64 ||
+      (InputTypeB && InputTypeB->getScalarSizeInBits() > 64) ||
+      AccumType->getScalarSizeInBits() > 64)
+    return Invalid;
----------------
MacDue wrote:

nit: Maybe change this to `if (OpBExtend != TTI::PR_None || BinOp)` check (and only check `AccumType`).

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


More information about the llvm-commits mailing list