[PATCH] D111555: [LoopVectorize] Add vector reduction support for fmuladd intrinsic

Rosie Sumpter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 12 01:43:46 PST 2021


RosieSumpter added a comment.

In D111555#3117640 <https://reviews.llvm.org/D111555#3117640>, @dmgreen wrote:

> I think, unlike the other opcodes in a reduction chain, we may need to check that the operand number is correct. The other opcodes are commutative so it doesn't matter which of the operands the reduction passes through, but for fmuladd we need to ensure we are dealing with the last addition parameter.

Good point. The example you gave was caught for ordered reductions by the `Exit->getOperand(2) != Phi` check in `checkOrderedReduction`, but for fast reductions it was being vectorized. I've added a check to `RecurrenceDescriptor::isRecurrenceInstr` to make sure the reduction phi is only the last operand, and added the example as a test.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111555/new/

https://reviews.llvm.org/D111555



More information about the llvm-commits mailing list