[all-commits] [llvm/llvm-project] 36d442: [LoopDataPrefetch + SystemZ] Let target decide on ...

Jonas Paulsson via All-commits all-commits at lists.llvm.org
Thu Apr 2 05:59:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 36d4421f50decce0d8257041c889ad33b38725b2
      https://github.com/llvm/llvm-project/commit/36d4421f50decce0d8257041c889ad33b38725b2
  Author: Jonas Paulsson <paulsson at linux.vnet.ibm.com>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/include/llvm/MC/MCSubtargetInfo.h
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/MC/MCSubtargetInfo.cpp
    M llvm/lib/Target/AArch64/AArch64Subtarget.h
    M llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
    M llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
    M llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
    A llvm/test/CodeGen/SystemZ/prefetch-02.ll
    A llvm/test/CodeGen/SystemZ/prefetch-03.ll
    A llvm/test/CodeGen/SystemZ/prefetch-04.ll

  Log Message:
  -----------
  [LoopDataPrefetch + SystemZ] Let target decide on prefetching for each loop.

This patch adds

- New arguments to getMinPrefetchStride() to let the target decide on a
  per-loop basis if software prefetching should be done even with a stride
  within the limit of the hw prefetcher.

- New TTI hook enableWritePrefetching() to let a target do write prefetching
  by default (defaults to false).

- In LoopDataPrefetch:

  - A search through the whole loop to gather information before emitting any
    prefetches. This way the target can get information via new arguments to
    getMinPrefetchStride() and emit prefetches more selectively. Collected
    information includes: Does the loop have a call, how many memory
    accesses, how many of them are strided, how many prefetches will cover
    them. This is NFC to before as long as the target does not change its
    definition of getMinPrefetchStride().

  - If a previous access to the same exact address was 'read', and the
    current one is 'write', make it a 'write' prefetch.

  - If two accesses that are covered by the same prefetch do not dominate
    each other, put the prefetch in a block that dominates both of them.

  - If a ConstantMaxTripCount is less than ItersAhead, then skip the loop.

- A SystemZ implementation of getMinPrefetchStride().

Review: Ulrich Weigand, Michael Kruse

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




More information about the All-commits mailing list