[AArch64] Add an FP load balancing pass for Cortex-A57
authorJames Molloy <james.molloy@arm.com>
Fri, 8 Aug 2014 12:33:21 +0000 (12:33 +0000)
committerJames Molloy <james.molloy@arm.com>
Fri, 8 Aug 2014 12:33:21 +0000 (12:33 +0000)
commit3a106a281317292b187844f6123474780bc4e94d
tree9fd669e98d0ad76fdcc9fab82dd420ba346de0eb
parentb56b2568969dd6424805292959084e494e34fa6c
[AArch64] Add an FP load balancing pass for Cortex-A57

For best-case performance on Cortex-A57, we should try to use a balanced mix of odd and even D-registers when performing a critical sequence of independent, non-quadword FP/ASIMD floating-point multiply or multiply-accumulate operations.

This pass attempts to detect situations where the register allocation may adversely affect this load balancing and to change the registers used so as to better utilize the CPU.

Ideally we'd just take each multiply or multiply-accumulate in turn and allocate it alternating even or odd registers. However, multiply-accumulates are most efficiently performed in the same functional unit as their accumulation operand. Therefore this pass tries to find maximal sequences ("Chains") of multiply-accumulates linked via their accumulation operand, and assign them all the same "color" (oddness/evenness).

This optimization affects S-register and D-register floating point multiplies and FMADD/FMAs, as well as vector (floating point only) muls and FMADD/FMA. Q register instructions (and 128-bit vector instructions) are not affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215199 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64.h
lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp [new file with mode: 0644]
lib/Target/AArch64/AArch64TargetMachine.cpp
lib/Target/AArch64/CMakeLists.txt
test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll [new file with mode: 0644]