[PATCH] D105432: [Analysis] Add simple cost model for strict (in-order) reductions

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 05:27:29 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1163
+  /// FastMathFlags parameter \p FPFlags together indicate what type of
+  /// reduction we are performing:
+  ///   1. Tree-wise. This is the typical 'fast' reduction performed that
----------------
dmgreen wrote:
> This comment looks useful. I'm wondering if it's worth emphasizing a bit that these are the default lowerings, and the cost should be whatever the fastest way the target can legally lower the intrinsic would be. 
> Maybe spelling out that that float operations without Reassoc require ordered reductions that look like `((((init + v0) + v1) + v2) + ..`. And otherwise the reduction can happen in any order, which by default will follow a treewise reduction.
Hi @dmgreen, thanks for the suggestions. In the 1) case below I do state this is the default for integer operations and FP when reassociation is allowed. I was trying to list the two types of reduction, then explain which is the default. What I could do is emphasise early on that "Tree-wise" is the default, i.e

  1. Tree-wise. This is the default, 'fast' reduction ...

I can also mention after 2) that the cost should correspond to the fastest way the target can lower the intrinsic?


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

https://reviews.llvm.org/D105432



More information about the llvm-commits mailing list