2014-05-24 20:50:23 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-linux-gnu | FileCheck %s
|
2013-01-31 20:12:40 +08:00
|
|
|
|
|
|
|
@var32 = global i32 0
|
|
|
|
@var64 = global i64 0
|
|
|
|
|
|
|
|
define void @foo() {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: foo:
|
2013-01-31 20:12:40 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%val1 = load volatile i32, i32* @var32
|
2013-01-31 20:12:40 +08:00
|
|
|
%tst1 = icmp eq i32 %val1, 0
|
2016-07-30 02:09:25 +08:00
|
|
|
br i1 %tst1, label %end, label %test2, !prof !1
|
2013-01-31 20:12:40 +08:00
|
|
|
; CHECK: cbz {{w[0-9]+}}, .LBB
|
|
|
|
|
|
|
|
test2:
|
2015-02-28 05:17:42 +08:00
|
|
|
%val2 = load volatile i32, i32* @var32
|
2013-01-31 20:12:40 +08:00
|
|
|
%tst2 = icmp ne i32 %val2, 0
|
2016-07-30 02:09:25 +08:00
|
|
|
br i1 %tst2, label %end, label %test3, !prof !1
|
2013-01-31 20:12:40 +08:00
|
|
|
; CHECK: cbnz {{w[0-9]+}}, .LBB
|
|
|
|
|
|
|
|
test3:
|
2015-02-28 05:17:42 +08:00
|
|
|
%val3 = load volatile i64, i64* @var64
|
2013-01-31 20:12:40 +08:00
|
|
|
%tst3 = icmp eq i64 %val3, 0
|
2016-07-30 02:09:25 +08:00
|
|
|
br i1 %tst3, label %end, label %test4, !prof !1
|
2013-01-31 20:12:40 +08:00
|
|
|
; CHECK: cbz {{x[0-9]+}}, .LBB
|
|
|
|
|
|
|
|
test4:
|
2015-02-28 05:17:42 +08:00
|
|
|
%val4 = load volatile i64, i64* @var64
|
2013-01-31 20:12:40 +08:00
|
|
|
%tst4 = icmp ne i64 %val4, 0
|
2016-07-30 02:09:25 +08:00
|
|
|
br i1 %tst4, label %end, label %test5, !prof !1
|
2017-01-12 03:55:19 +08:00
|
|
|
; CHECK: cbnz {{x[0-9]+}}, .LBB
|
2013-01-31 20:12:40 +08:00
|
|
|
|
|
|
|
test5:
|
|
|
|
store volatile i64 %val4, i64* @var64
|
|
|
|
ret void
|
|
|
|
|
|
|
|
end:
|
|
|
|
ret void
|
2013-07-14 04:38:47 +08:00
|
|
|
}
|
2016-07-30 02:09:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
!1 = !{!"branch_weights", i32 1, i32 1}
|