diff options
| author | Juergen Ributzka <juergen@apple.com> | 2014-09-18 02:44:13 +0000 |
|---|---|---|
| committer | Juergen Ributzka <juergen@apple.com> | 2014-09-18 02:44:13 +0000 |
| commit | c35fb03661a25d07c47453489bdcb39cf7237ff8 (patch) | |
| tree | de57f9b20e8c976b3169d18b70b92c491a4a9489 /llvm/test/CodeGen/AArch64/fast-isel-tbz.ll | |
| parent | b404cb8e3945aad152d5769a9a6962387fd7544c (diff) | |
| download | bcm5719-llvm-c35fb03661a25d07c47453489bdcb39cf7237ff8.tar.gz bcm5719-llvm-c35fb03661a25d07c47453489bdcb39cf7237ff8.zip | |
[FastISel][AArch64] Fold bit test and branch into TBZ and TBNZ.
Teach selectBranch to fold bit test and branch into a single instruction (TBZ or
TBNZ).
llvm-svn: 218010
Diffstat (limited to 'llvm/test/CodeGen/AArch64/fast-isel-tbz.ll')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/fast-isel-tbz.ll | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/fast-isel-tbz.ll b/llvm/test/CodeGen/AArch64/fast-isel-tbz.ll new file mode 100644 index 00000000000..313abd31829 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/fast-isel-tbz.ll @@ -0,0 +1,50 @@ +; RUN: llc -fast-isel -fast-isel-abort -aarch64-atomic-cfg-tidy=0 -verify-machineinstrs -mtriple=aarch64-apple-darwin < %s | FileCheck %s + +define i32 @icmp_eq_i8(i8 zeroext %a) { +; CHECK-LABEL: icmp_eq_i8 +; CHECK: tbz w0, #0, {{LBB.+_2}} + %1 = and i8 %a, 1 + %2 = icmp eq i8 %1, 0 + br i1 %2, label %bb1, label %bb2 +bb2: + ret i32 1 +bb1: + ret i32 0 +} + +define i32 @icmp_eq_i16(i16 zeroext %a) { +; CHECK-LABEL: icmp_eq_i16 +; CHECK: tbz w0, #1, {{LBB.+_2}} + %1 = and i16 %a, 2 + %2 = icmp eq i16 %1, 0 + br i1 %2, label %bb1, label %bb2 +bb2: + ret i32 1 +bb1: + ret i32 0 +} + +define i32 @icmp_eq_i32(i32 %a) { +; CHECK-LABEL: icmp_eq_i32 +; CHECK: tbz w0, #2, {{LBB.+_2}} + %1 = and i32 %a, 4 + %2 = icmp eq i32 %1, 0 + br i1 %2, label %bb1, label %bb2 +bb2: + ret i32 1 +bb1: + ret i32 0 +} + +define i32 @icmp_eq_i64(i64 %a) { +; CHECK-LABEL: icmp_eq_i64 +; CHECK: tbz x0, #3, {{LBB.+_2}} + %1 = and i64 %a, 8 + %2 = icmp eq i64 %1, 0 + br i1 %2, label %bb1, label %bb2 +bb2: + ret i32 1 +bb1: + ret i32 0 +} + |

