[PATCH] D98031: [ARM] Add an optimization to avoid S-register forwarding hazards

Andrew Savonichev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 5 03:30:54 PST 2021


asavonic created this revision.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, mgorny.
asavonic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Register forwarding hazards might occur when one uop reads a D- or
Q-register operand that has recently been written with one or more
S-register results. This happens only in AArch32 state on Cortex-A57,
Cortex-A72, Cortex-A77 (and probably other processors as well).

The pass replaces S-registers writes with the corresponding scalar
writes to D-registers. If there is no suitable replacement, an
S-register is copied to a D-register scalar via a core register.

The pass is disabled by default and it can be enabled by
-arm-subreg-write LLVM option when non-zero optimization level is set.

With this optimization, llvm-test-suite/MultiSource/Benchmarks/Bullet
shows ~10% performance improvement on Cortex-A72.

The pass has also been tested on Skia library. Skia's nanobench shows
~1.3% geomean improvement and ~10% improvement for some subtests on
Cortex-A72.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98031

Files:
  llvm/lib/Target/ARM/ARM.h
  llvm/lib/Target/ARM/ARMSubregWrite.cpp
  llvm/lib/Target/ARM/ARMTargetMachine.cpp
  llvm/lib/Target/ARM/CMakeLists.txt
  llvm/test/CodeGen/ARM/arm-subreg-write.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98031.328468.patch
Type: text/x-patch
Size: 32557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210305/f0f4ba76/attachment.bin>


More information about the llvm-commits mailing list