[AAarch64] Optimize CSINC-branch sequence
authorGerolf Hoflehner <ghoflehner@apple.com>
Tue, 14 Oct 2014 23:07:53 +0000 (23:07 +0000)
committerGerolf Hoflehner <ghoflehner@apple.com>
Tue, 14 Oct 2014 23:07:53 +0000 (23:07 +0000)
commit2bddd7cf6584709a7b1419c38c34749bb3962dcb
tree06e3528fc1bfa26a8545bd632990da97d37604ee
parent75277b9f70a086b0dcdf5c71cdca6d58e9d29941
[AAarch64] Optimize CSINC-branch sequence

Peephole optimization that generates a single conditional branch
for csinc-branch sequences like in the examples below. This is
possible when the csinc sets or clears a register based on a condition
code and the branch checks that register. Also the condition
code may not be modified between the csinc and the original branch.

Examples:

1. Convert csinc w9, wzr, wzr, <CC>;tbnz w9, #0, 0x44
   to b.<invCC>

2. Convert csinc w9, wzr, wzr, <CC>; tbz w9, #0, 0x44
   to b.<CC>

rdar://problem/18506500

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219742 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/PeepholeOptimizer.cpp
lib/Target/AArch64/AArch64InstrInfo.cpp
lib/Target/AArch64/AArch64InstrInfo.h
test/CodeGen/AArch64/arm64-bcc.ll [new file with mode: 0644]