[llvm] [LoopVectorizer][AArch64] Add support for partial reduce subtraction (PR #123636)
    David Sherwood via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Feb 25 05:35:49 PST 2025
    
    
  
================
@@ -8800,6 +8800,10 @@ bool VPRecipeBuilder::getScaledReductions(
     return false;
 
   using namespace llvm::PatternMatch;
+  // Use the side-effect of match to replace BinOp only if the pattern is
+  // matched, we don't care at this point whether it actually matched.
+  match(BinOp, m_Neg(m_BinOp(BinOp)));
----------------
david-arm wrote:
I don't understand how this works. We've already bailed out above if `BinOp` is not a BinaryOperator, which surely means that it cannot simultaneously be a unary operator, which was m_Neg represents?
https://github.com/llvm/llvm-project/pull/123636
    
    
More information about the llvm-commits
mailing list