[all-commits] [llvm/llvm-project] 92c8ef: [LV][AArch64] LoopVectorizer allows scalable frem ...

Paschalis Mpeis via All-commits all-commits at lists.llvm.org
Tue Jan 9 09:36:04 PST 2024


  Branch: refs/heads/users/paschalis-mpeis/loop-vectorizer-frem-scalable
  Home:   https://github.com/llvm/llvm-project
  Commit: 92c8ef778ddcdfe2f73ed50c4abb63ac417fce3f
      https://github.com/llvm/llvm-project/commit/92c8ef778ddcdfe2f73ed50c4abb63ac417fce3f
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/AArch64/arith-fp-sve.ll
    M llvm/test/Analysis/CostModel/AArch64/arith-fp.ll

  Log Message:
  -----------
  [LV][AArch64] LoopVectorizer allows scalable frem instructions

In AArch64, when an 'frem' instruction uses scalable vectors, it will be
replaced with a vector library call. LoopVectorize is now aware of that
so it no longer returns invalid costs.

When it is not scalable, it returns the default costs, which are
delegated to the BaseT TTI Implementation.


  Commit: d872bc43c4614be5f77625479b47eadfbe2d35ba
      https://github.com/llvm/llvm-project/commit/d872bc43c4614be5f77625479b47eadfbe2d35ba
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Analysis/CostModel/AArch64/arith-fp-sve-frem.ll
    M llvm/test/Analysis/CostModel/AArch64/arith-fp-sve.ll

  Log Message:
  -----------
  [LV][AArch64] LoopVectorizer allows scalable frem instructions

LoopVectorizer is aware when a target can replace a scalable frem
instruction with a vector library call and it returns the relevant cost.
Otherwise, it returns an invalid cost (as previously).

Add test that check costs on AArch64, when there is no vector library
available and when there is, with and without tail-folding.

NOTE: Invoking CostModel directly (not through LV) would still return
invalid costs. To avoid this, it would require passing TargetLibraryInfo
to TargetTransformInfo API, which we preferred not to as the 'frem'
instruction is an isolated case.


  Commit: ca9f165122ad5d6c061ac9748e1dde49afa9669e
      https://github.com/llvm/llvm-project/commit/ca9f165122ad5d6c061ac9748e1dde49afa9669e
  Author: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Analysis/CostModel/AArch64/arith-fp-sve.ll
    M llvm/test/Analysis/CostModel/AArch64/arith-fp.ll

  Log Message:
  -----------
  Addressing reviewers.

Comparing against the default cost, and no longer restricting to
scalable types.


Compare: https://github.com/llvm/llvm-project/compare/a041258a20f9...ca9f165122ad


More information about the All-commits mailing list