1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=sparcv9 -disable-sparc-leaf-proc | FileCheck %s
4 ;; 1. When emitting code for v9, CCR branches should always explicitly specify
6 ;; 2. Branches on the result of a 64-bit compare with constant zero should be
7 ;; lowered into an instruction in the BPr class (§A.3 in V9 spec).
8 ;; 3. There should never be a `ba` that jumps into two instructions immediately
11 define void @bricc(i32 signext %sel) {
13 ; CHECK: .cfi_startproc
14 ; CHECK-NEXT: ! %bb.0: ! %entry
15 ; CHECK-NEXT: save %sp, -176, %sp
16 ; CHECK-NEXT: .cfi_def_cfa_register %fp
17 ; CHECK-NEXT: .cfi_window_save
18 ; CHECK-NEXT: .cfi_register %o7, %i7
19 ; CHECK-NEXT: cmp %i0, 0
20 ; CHECK-NEXT: be %icc, .LBB0_2
22 ; CHECK-NEXT: ! %bb.1: ! %fbb
25 ; CHECK-NEXT: ba .LBB0_3
27 ; CHECK-NEXT: .LBB0_2: ! %tbb
30 ; CHECK-NEXT: .LBB0_3: ! %end
36 %cond = icmp eq i32 %sel, 0
37 br i1 %cond, label %tbb, label %fbb
52 define void @brxcc(i64 %sel) {
54 ; CHECK: .cfi_startproc
55 ; CHECK-NEXT: ! %bb.0: ! %entry
56 ; CHECK-NEXT: save %sp, -176, %sp
57 ; CHECK-NEXT: .cfi_def_cfa_register %fp
58 ; CHECK-NEXT: .cfi_window_save
59 ; CHECK-NEXT: .cfi_register %o7, %i7
60 ; CHECK-NEXT: cmp %i0, 1
61 ; CHECK-NEXT: bne %xcc, .LBB1_2
63 ; CHECK-NEXT: ! %bb.1: ! %tbb
66 ; CHECK-NEXT: ba .LBB1_3
68 ; CHECK-NEXT: .LBB1_2: ! %fbb
71 ; CHECK-NEXT: .LBB1_3: ! %end
77 ;; Using 1 here because compares with zero
78 ;; will be lowered into a `brz`, not `be`.
79 %cond = icmp eq i64 %sel, 1
80 br i1 %cond, label %tbb, label %fbb
95 define void @brreg(i64 %sel) {
97 ; CHECK: .cfi_startproc
98 ; CHECK-NEXT: ! %bb.0: ! %entry
99 ; CHECK-NEXT: save %sp, -176, %sp
100 ; CHECK-NEXT: .cfi_def_cfa_register %fp
101 ; CHECK-NEXT: .cfi_window_save
102 ; CHECK-NEXT: .cfi_register %o7, %i7
103 ; CHECK-NEXT: brz %i0, .LBB2_2
105 ; CHECK-NEXT: ! %bb.1: ! %fbb
106 ; CHECK-NEXT: call f2
108 ; CHECK-NEXT: ba .LBB2_3
110 ; CHECK-NEXT: .LBB2_2: ! %tbb
111 ; CHECK-NEXT: call f1
113 ; CHECK-NEXT: .LBB2_3: ! %end
114 ; CHECK-NEXT: call f3
117 ; CHECK-NEXT: restore
119 %cond = icmp eq i64 %sel, 0
120 br i1 %cond, label %tbb, label %fbb
135 declare void @f1(...)
137 declare void @f2(...)
139 declare void @f3(...)