MachineCombiner Pass for selecting faster instruction
authorGerolf Hoflehner <ghoflehner@apple.com>
Sun, 3 Aug 2014 22:03:40 +0000 (22:03 +0000)
committerGerolf Hoflehner <ghoflehner@apple.com>
Sun, 3 Aug 2014 22:03:40 +0000 (22:03 +0000)
commit48e1bd7287c9eb799cf0031b374ea1fe4f0c08c6
treedb01e4521cd2e8d7368ef6a8f5edd1434f889f4d
parentb0b708854ec3cd8047b4659d2ef881bc7d1b582c
MachineCombiner Pass for selecting faster instruction
 sequence -  AArch64 target support

 This patch turns off madd/msub generation in the DAGCombiner and generates
 them in the MachineCombiner instead. It replaces the original code sequence
 with the combined sequence when it is beneficial to do so.

 When there is no machine model support it always generates the madd/msub
 instruction. This is true also when the objective is to optimize for code
 size: when the combined sequence is shorter is always chosen and does not
 get evaluated.

 When there is a machine model the combined instruction sequence
 is evaluated for critical path and resource length using machine
 trace metrics and the original code sequence is replaced when it is
 determined to be faster.

 rdar://16319955

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214669 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64InstrFormats.td
lib/Target/AArch64/AArch64InstrInfo.cpp
lib/Target/AArch64/AArch64InstrInfo.h
lib/Target/AArch64/AArch64MachineCombinerPattern.h [new file with mode: 0644]
lib/Target/AArch64/AArch64TargetMachine.cpp
test/CodeGen/AArch64/arm64-neon-mul-div.ll
test/CodeGen/AArch64/dp-3source.ll
test/CodeGen/AArch64/madd-lohi.ll [new file with mode: 0644]
test/CodeGen/AArch64/mul-lohi.ll