================
@@ -3524,14 +3524,22 @@ 
tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
   };
 
   VPValue *VecOp = Red->getVecOp();
+  VPValue *Mul = nullptr;
+  VPValue *Sub = nullptr;
   VPValue *A, *B;
+  // Sub reductions could have a sub between the add reduction and vec op.
+  if (match(VecOp,
+            m_Binary<Instruction::Sub>(m_SpecificInt(0), m_VPValue(Mul))))
+    Sub = VecOp;
+  else
+    Mul = VecOp;
----------------
sdesmalen-arm wrote:

There is a lot of renaming going on, making this change a lot bigger than it 
should be. If you would write:
```
VPValue *Sub = nullptr;
// Sub reductions could have a sub between the add reduction and vec op.
if (match(VecOp,
          m_Binary<Instruction::Sub>(m_SpecificInt(0), m_VPValue(VecOp))))
  Sub = Red->getVecOp();
```
Then you can do away with the changes that just rename `VecOp` -> `Mul` and 
`Mul -> MulR`.

I mentioned this in a previous review, but this suggestion somehow got reverted 
again. 

https://github.com/llvm/llvm-project/pull/160154
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to