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

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 23 04:43:59 PST 2021


paulwalker-arm added a comment.

@mdchen: This looks like a tricky question depending on your interpretation of the LangRef.  There's this line in the semantics for `llvm.fma`:

  When specified with the fast-math-flag ‘afn’, the result may be approximated using a less accurate calculation.

Which suggests, from an accuracy point of view, no other fast-math-flag is considered.  Then it comes down to what "approximated using a less accurate" means when `afn` is specified.  My reading is the underlying operation must be maintained (i.e. a fused multiply-add) but perhaps at less precision, for example rounding double operands to float.  That's to say the precision between the multiply and add is still infinite even though the operands themselves can be rounded to something of lower precision.

To me this suggests it's never correct for LoopVectorize to split an `llvm.fma` into separate fmul and fadd operations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111555



More information about the llvm-commits mailing list