[all-commits] [llvm/llvm-project] 0bb7bd: [AArch64] Runtime-unroll small load/store loops fo...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Mon Dec 9 06:28:53 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0bb7bd4b4ec8efdb3988f7e907fb0490841b02bb
https://github.com/llvm/llvm-project/commit/0bb7bd4b4ec8efdb3988f7e907fb0490841b02bb
Author: Florian Hahn <flo at fhahn.com>
Date: 2024-12-09 (Mon, 09 Dec 2024)
Changed paths:
M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
M llvm/test/Transforms/LoopUnroll/AArch64/apple-unrolling.ll
Log Message:
-----------
[AArch64] Runtime-unroll small load/store loops for Apple Silicon CPUs. (#118317)
Add initial heuristics to selectively enable runtime unrolling for loops
where doing so is expected to be highly beneficial on Apple Silicon
CPUs.
To start with, we try to runtime-unroll small, single block loops, if
they have load/store dependencies, to expose more parallel memory
access streams [1] and to improve instruction delivery [2].
We also explicitly avoid runtime-unrolling for loop structures that may
limit the expected gains from runtime unrolling. Such loops include
loops with complex control flow (aren't innermost loops, have multiple
exits, have a large number of blocks), trip count expansion is
expensive and are expected to execute a small number of iterations.
Note that the heuristics here may be overly conservative and we err on
the side of avoiding runtime unrolling rather than unroll excessively.
They are all subject to further refinement.
Across a large set of workloads, this increase the total number of
unrolled loops by 2.9%.
[1] 4.6.10 in Apple Silicon CPU Optimization Guide
[2] 4.4.4 in Apple Silicon CPU Optimization Guide
Depends on https://github.com/llvm/llvm-project/pull/118316 for TTI
changes.
PR: https://github.com/llvm/llvm-project/pull/118317
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list