1 ; RUN: llc < %s -O1 -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -ppc-use-branch-hint=false | FileCheck %s
2 ; RUN: llc < %s -O1 -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -ppc-use-branch-hint=true | FileCheck %s -check-prefix=CHECK-HINT
3 define void @branch_hint_1(i32 %src) {
5 %cmp = icmp eq i32 %src, 0
6 br i1 %cmp, label %if.then, label %if.end
9 tail call void @foo() #0
16 ; CHECK-LABEL: branch_hint_1:
19 ; CHECK-HINT-LABEL: branch_hint_1:
23 define void @branch_hint_2(i32 %src) {
25 %cmp = icmp eq i32 %src, 0
26 br i1 %cmp, label %if.then, label %if.end
33 tail call void @foo() #0
36 ; CHECK-LABEL: @branch_hint_2
39 ; CHECK-HINT-LABEL: @branch_hint_2
44 attributes #0 = { noreturn }
46 define void @branch_hint_3(i32 %src) {
48 %cmp = icmp eq i32 %src, 0
49 br i1 %cmp, label %if.then, label %if.end, !prof !0
59 ; CHECK-LABEL: @branch_hint_3
62 ; CHECK-HINT-LABEL: @branch_hint_3
66 !0 = !{!"branch_weights", i32 64, i32 4}
68 define void @branch_hint_4(i32 %src) {
70 %cmp = icmp eq i32 %src, 0
71 br i1 %cmp, label %if.then, label %if.end, !prof !1
81 ; CHECK-HINT-LABEL: branch_hint_4
85 !1 = !{!"branch_weights", i32 64, i32 8}
87 define void @branch_hint_5(i32 %src) {
89 %cmp = icmp eq i32 %src, 0
90 br i1 %cmp, label %if.then, label %if.end
99 ; CHECK-HINT-LABEL: branch_hint_5:
105 define void @branch_hint_6(i32 %src1, i32 %src2, i32 %src3) {
107 %cmp = icmp eq i32 %src1, 0
108 br i1 %cmp, label %if.end.6, label %if.end, !prof !3
111 %cmp1 = icmp eq i32 %src2, 0
112 br i1 %cmp1, label %if.end.3, label %if.then.2
115 tail call void @foo() #0
119 %cmp4 = icmp eq i32 %src3, 1
120 br i1 %cmp4, label %if.then.5, label %if.end.6
123 tail call void @foo() #0
129 ; CHECK-HINT-LABEL: branch_hint_6:
135 !3 = !{!"branch_weights", i32 64, i32 4}