[all-commits] [llvm/llvm-project] 219d45: [Analysis][AArch64] Make fixed-width ordered reduc...

david-arm via All-commits all-commits at lists.llvm.org
Wed Aug 18 09:02:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 219d4518fce9aafcb5eba9b92fb778837f0a4827
      https://github.com/llvm/llvm-project/commit/219d4518fce9aafcb5eba9b92fb778837f0a4827
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2021-08-18 (Wed, 18 Aug 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/AArch64/reduce-fadd.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd-cost.ll

  Log Message:
  -----------
  [Analysis][AArch64] Make fixed-width ordered reductions slightly more expensive

For tight loops like this:

  float r = 0;
  for (int i = 0; i < n; i++) {
    r += a[i];
  }

it's better not to vectorise at -O3 using fixed-width ordered reductions
on AArch64 targets. Although the resulting number of instructions in the
generated code ends up being comparable to not vectorising at all, there
may be additional costs on some CPUs, for example perhaps the scheduling
is worse. It makes sense to deter vectorisation in tight loops.

Differential Revision: https://reviews.llvm.org/D108292




More information about the All-commits mailing list