[PATCH] D111555: [LoopVectorize] Add strict reduction support for fmuladd intrinsic
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 15 10:25:27 PDT 2021
paulwalker-arm added inline comments.
================
Comment at: llvm/lib/Analysis/IVDescriptors.cpp:205-210
+ // Recognise a call to the llvm.fmuladd intrinsic.
+ bool IsFMulAdd = RecurrenceDescriptor::isFMulAddIntrinsic(Exit);
+
+ if ((Exit->getOpcode() != Instruction::FAdd && !IsFMulAdd) ||
+ Exit != ExactFPMathInst)
return false;
----------------
paulwalker-arm wrote:
> Just a suggestion but given this function no longer has a single instruction to care about perhaps it's worth being more explicit. For example:
> ```
> if (Kind == RecurKind::FAdd && Exit->getOpcode() != Instruction::FAdd)
> return false;
> if (Kind == RecurKind::FMulAdd && RecurrenceDescriptor::isFMulAddIntrinsic(Exit))
> return false
> if (Exit != ExactFPMathInst)
> return false;
> ```
Or rather:
```
if (Kind == RecurKind::FAdd && Exit->getOpcode() != Instruction::FAdd)
return false;
if (Kind == RecurKind::FMulAdd && !RecurrenceDescriptor::isFMulAddIntrinsic(Exit))
return false
if (Exit != ExactFPMathInst)
return false;
```
:)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111555/new/
https://reviews.llvm.org/D111555
More information about the llvm-commits
mailing list