1 ;; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;; Test that Octeon BBIT family of branch can be replaced by
3 ;; the long branch expansion pass.
5 ; RUN: llc -O3 -mtriple=mips64-octeon-linux -mcpu=octeon -force-mips-long-branch < %s -o - | FileCheck %s
7 define i64 @bbit1(i64 %a) nounwind {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: bbit0 $4, 3, .LBB0_2
12 ; CHECK-NEXT: # %bb.1: # %entry
13 ; CHECK-NEXT: j .LBB0_3
15 ; CHECK-NEXT: .LBB0_2: # %endif
17 ; CHECK-NEXT: daddiu $2, $zero, 12
18 ; CHECK-NEXT: .LBB0_3: # %if
20 ; CHECK-NEXT: daddiu $2, $zero, 48
23 %res = icmp eq i64 %bit, 0
24 br i1 %res, label %endif, label %if
32 define i64 @bbit132(i64 %a) nounwind {
33 ; CHECK-LABEL: bbit132:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: bbit032 $4, 3, .LBB1_2
37 ; CHECK-NEXT: # %bb.1: # %entry
38 ; CHECK-NEXT: j .LBB1_3
40 ; CHECK-NEXT: .LBB1_2: # %endif
42 ; CHECK-NEXT: daddiu $2, $zero, 12
43 ; CHECK-NEXT: .LBB1_3: # %if
45 ; CHECK-NEXT: daddiu $2, $zero, 48
47 %bit = and i64 %a, 34359738368
48 %res = icmp eq i64 %bit, 0
49 br i1 %res, label %endif, label %if
57 define i64 @bbit0(i64 %a) nounwind {
59 ; CHECK: # %bb.0: # %entry
60 ; CHECK-NEXT: bbit1 $4, 3, .LBB2_2
62 ; CHECK-NEXT: # %bb.1: # %entry
63 ; CHECK-NEXT: j .LBB2_3
65 ; CHECK-NEXT: .LBB2_2: # %endif
67 ; CHECK-NEXT: daddiu $2, $zero, 12
68 ; CHECK-NEXT: .LBB2_3: # %if
70 ; CHECK-NEXT: daddiu $2, $zero, 48
73 %res = icmp ne i64 %bit, 0
74 br i1 %res, label %endif, label %if
82 define i64 @bbit032(i64 %a) nounwind {
83 ; CHECK-LABEL: bbit032:
84 ; CHECK: # %bb.0: # %entry
85 ; CHECK-NEXT: bbit132 $4, 3, .LBB3_2
87 ; CHECK-NEXT: # %bb.1: # %entry
88 ; CHECK-NEXT: j .LBB3_3
90 ; CHECK-NEXT: .LBB3_2: # %endif
92 ; CHECK-NEXT: daddiu $2, $zero, 12
93 ; CHECK-NEXT: .LBB3_3: # %if
95 ; CHECK-NEXT: daddiu $2, $zero, 48
97 %bit = and i64 %a, 34359738368
98 %res = icmp ne i64 %bit, 0
99 br i1 %res, label %endif, label %if