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 3define void @branch_hint_1(i32 %src) { 4entry: 5 %cmp = icmp eq i32 %src, 0 6 br i1 %cmp, label %if.then, label %if.end 7 8if.then: 9 tail call void @foo() #0 10 unreachable 11 12if.end: 13 call void @goo() 14 ret void 15 16; CHECK-LABEL: branch_hint_1: 17; CHECK: beq 18 19; CHECK-HINT-LABEL: branch_hint_1: 20; CHECK-HINT: beq- 21} 22 23define void @branch_hint_2(i32 %src) { 24entry: 25 %cmp = icmp eq i32 %src, 0 26 br i1 %cmp, label %if.then, label %if.end 27 28if.then: 29 call void @goo() 30 ret void 31 32if.end: 33 tail call void @foo() #0 34 unreachable 35 36; CHECK-LABEL: @branch_hint_2 37; CHECK: bne 38 39; CHECK-HINT-LABEL: @branch_hint_2 40; CHECK-HINT: bne- 41} 42 43declare void @foo() 44attributes #0 = { noreturn } 45 46define void @branch_hint_3(i32 %src) { 47entry: 48 %cmp = icmp eq i32 %src, 0 49 br i1 %cmp, label %if.then, label %if.end, !prof !0 50 51if.then: 52 call void @foo() 53 ret void 54 55if.end: 56 call void @goo() 57 ret void 58 59; CHECK-LABEL: @branch_hint_3 60; CHECK: bne 61 62; CHECK-HINT-LABEL: @branch_hint_3 63; CHECK-HINT: bne 64} 65 66!0 = !{!"branch_weights", i32 64, i32 4} 67 68define void @branch_hint_4(i32 %src) { 69entry: 70 %cmp = icmp eq i32 %src, 0 71 br i1 %cmp, label %if.then, label %if.end, !prof !1 72 73if.then: 74 call void @foo() 75 ret void 76 77if.end: 78 call void @goo() 79 ret void 80 81; CHECK-HINT-LABEL: branch_hint_4 82; CHECK-HINT: bne 83} 84 85!1 = !{!"branch_weights", i32 64, i32 8} 86 87define void @branch_hint_5(i32 %src) { 88entry: 89 %cmp = icmp eq i32 %src, 0 90 br i1 %cmp, label %if.then, label %if.end 91 92if.then: 93 ret void 94 95if.end: 96 call void @goo() 97 ret void 98 99; CHECK-HINT-LABEL: branch_hint_5: 100; CHECK-HINT: beq 101} 102 103declare void @goo() 104 105define void @branch_hint_6(i32 %src1, i32 %src2, i32 %src3) { 106entry: 107 %cmp = icmp eq i32 %src1, 0 108 br i1 %cmp, label %if.end.6, label %if.end, !prof !3 109 110if.end: 111 %cmp1 = icmp eq i32 %src2, 0 112 br i1 %cmp1, label %if.end.3, label %if.then.2 113 114if.then.2: 115 tail call void @foo() #0 116 unreachable 117 118if.end.3: 119 %cmp4 = icmp eq i32 %src3, 1 120 br i1 %cmp4, label %if.then.5, label %if.end.6 121 122if.then.5: 123 tail call void @foo() #0 124 unreachable 125 126if.end.6: 127 ret void 128 129; CHECK-HINT-LABEL: branch_hint_6: 130; CHECK-HINT: bne 131; CHECK-HINT: bne- 132; CHECK-HINT: bne+ 133} 134 135!3 = !{!"branch_weights", i32 64, i32 4} 136