CodeGenPrep: wrangle IR to exploit AArch64 tbz/tbnz inst.
authorTim Northover <tnorthover@apple.com>
Sat, 29 Mar 2014 08:22:29 +0000 (08:22 +0000)
committerTim Northover <tnorthover@apple.com>
Sat, 29 Mar 2014 08:22:29 +0000 (08:22 +0000)
commit1db780ba2244edf46f1f6880e5730511a9d5f12d
treea0bd7cee801e895bb8f701ea31d1f58dcbe2568a
parent8a272f00a0eb100a1d1527eb895ba6cf5074045a
CodeGenPrep: wrangle IR to exploit AArch64 tbz/tbnz inst.

Given IR like:
    %bit = and %val, #imm-with-1-bit-set
    %tst = icmp %bit, 0
    br i1 %tst, label %true, label %false

some targets can emit just a single instruction (tbz/tbnz in the
AArch64 case). However, with ISel acting at the basic-block level, all
three instructions need to be together for this to be possible.

This adds another transformation to CodeGenPrep to expose these
opportunities, if targets opt in via the hook.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205086 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/CodeGenPrepare.cpp
lib/CodeGen/TargetLoweringBase.cpp