81 lines · plain
1; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s | FileCheck %s2; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux -precise-rotation-cost < %s | FileCheck %s -check-prefix=CHECK-PROFILE3 4define void @foo() {5; Test that not all edges in the loop chain are fall through without profile6; data.7;8; CHECK-LABEL: foo:9; CHECK: callq e10; CHECK: callq f11; CHECK: callq g12; CHECK: callq h13 14entry:15 br label %header16 17header:18 call void @e()19 %call = call zeroext i1 @a()20 br i1 %call, label %if.then, label %if.else, !prof !221 22if.then:23 call void @f()24 br label %if.end25 26if.else:27 call void @g()28 br label %if.end29 30if.end:31 call void @h()32 %call2 = call zeroext i1 @a()33 br i1 %call2, label %header, label %end34 35end:36 ret void37}38 39define void @bar() !prof !1 {40; Test that all edges in the loop chain are fall through with profile data.41;42; CHECK-PROFILE-LABEL: bar:43; CHECK-PROFILE: callq g44; CHECK-PROFILE: callq h45; CHECK-PROFILE: callq e46; CHECK-PROFILE: callq f47 48entry:49 br label %header50 51header:52 call void @e()53 %call = call zeroext i1 @a()54 br i1 %call, label %if.then, label %if.else, !prof !255 56if.then:57 call void @f()58 br label %if.end59 60if.else:61 call void @g()62 br label %if.end63 64if.end:65 call void @h()66 %call2 = call zeroext i1 @a()67 br i1 %call2, label %header, label %end68 69end:70 ret void71}72 73declare zeroext i1 @a()74declare void @e()75declare void @f()76declare void @g()77declare void @h()78 79!1 = !{!"function_entry_count", i64 1}80!2 = !{!"branch_weights", i32 16, i32 16}81