[llvm] [LoopVectorizer][AArch64] Add support for partial reduce subtraction (PR #123636)

Nicholas Guy via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 04:48:30 PST 2025


================
@@ -8932,6 +8936,20 @@ VPRecipeBuilder::tryToCreatePartialReduction(Instruction *Reduction,
     std::swap(BinOp, Accumulator);
 
   unsigned ReductionOpcode = Reduction->getOpcode();
+  if (ReductionOpcode == Instruction::Sub) {
+    VPBasicBlock *ParentBlock = Builder.getInsertBlock();
+    if (!ParentBlock)
+      return nullptr;
----------------
NickGuy-Arm wrote:

I haven't seen any case where it would be, so this was just a bit of defensiveness for something I wasn't 100% sure on. I can switch it to an assert, or remove it altogether if you think the check is irrelevant.

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


More information about the llvm-commits mailing list