1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/test/CodeGen/AArch64/fast-isel-branch-cond-mask.ll
Matthias Braun 096ba9c487 AArch64FastISel: Use cbz/cbnz to branch on i1
In the case of a conditional branch without a preceding cmp we used to emit
a "and; cmp; b.eq/b.ne" sequence, use tbz/tbnz instead.

Differential Revision: http://reviews.llvm.org/D15122

llvm-svn: 254621
2015-12-03 17:19:58 +00:00

20 lines
490 B
LLVM

; RUN: llc -mtriple=aarch64-apple-darwin -O0 -fast-isel -fast-isel-abort=0 -verify-machineinstrs < %s | FileCheck %s
define void @test(i64 %a, i64 %b, i2* %c) {
; CHECK-LABEL: test
; CHECK: and [[REG1:w[0-9]+]], w8, #0x3
; CHECK-NEXT: strb [[REG1]], {{\[}}x2{{\]}}
; CHECK-NEXT: tbz w9, #0,
%1 = trunc i64 %a to i2
%2 = trunc i64 %b to i1
; Force fast-isel to fall back to SDAG.
store i2 %1, i2* %c, align 8
br i1 %2, label %bb1, label %bb2
bb1:
ret void
bb2:
ret void
}