1- ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: -p --version 5
1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: -p --check-globals all -- version 5
22; RUN: opt -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -simple-loop-unswitch-guards -S < %s | FileCheck %s
33; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -simple-loop-unswitch-guards -S < %s | FileCheck %s
44; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -simple-loop-unswitch-guards -verify-memoryssa -verify-loop-info -S < %s | FileCheck %s
55
66declare void @llvm.experimental.guard (i1 , ...)
77
8- define void @test_simple_case (i1 %cond , i32 %N ) {
9- ; CHECK-LABEL: define void @test_simple_case(i1 %cond, i32 %N) {
8+ define void @test_simple_case (i1 %cond , i32 %N ) !prof !0 {
9+ ; CHECK-LABEL: define void @test_simple_case(i1 %cond, i32 %N) !prof !0 {
1010; CHECK-NEXT: entry:
11- ; CHECK-NEXT: br i1 %cond, label %entry.split.us, label %entry.split
11+ ; CHECK-NEXT: br i1 %cond, label %entry.split.us, label %entry.split, !prof !1
1212; CHECK: entry.split.us:
1313; CHECK-NEXT: br label %loop.us
1414; CHECK: loop.us:
4848define void @test_two_guards (i1 %cond1 , i1 %cond2 , i32 %N ) {
4949; CHECK-LABEL: define void @test_two_guards(i1 %cond1, i1 %cond2, i32 %N) {
5050; CHECK-NEXT: entry:
51- ; CHECK-NEXT: br i1 %cond1, label %entry.split.us, label %entry.split
51+ ; CHECK-NEXT: br i1 %cond1, label %entry.split.us, label %entry.split, !prof !1
5252; CHECK: entry.split.us:
53- ; CHECK-NEXT: br i1 %cond2, label %entry.split.us.split.us, label %entry.split.us.split
53+ ; CHECK-NEXT: br i1 %cond2, label %entry.split.us.split.us, label %entry.split.us.split, !prof !1
5454; CHECK: entry.split.us.split.us:
5555; CHECK-NEXT: br label %loop.us.us
5656; CHECK: loop.us.us:
@@ -105,7 +105,7 @@ define void @test_conditional_guards(i1 %cond, i32 %N) {
105105; CHECK-LABEL: define void @test_conditional_guards(i1 %cond, i32 %N) {
106106; CHECK-NEXT: entry:
107107; CHECK-NEXT: %cond.fr = freeze i1 %cond
108- ; CHECK-NEXT: br i1 %cond.fr, label %entry.split.us, label %entry.split
108+ ; CHECK-NEXT: br i1 %cond.fr, label %entry.split.us, label %entry.split, !prof !1
109109; CHECK: entry.split.us:
110110; CHECK-NEXT: br label %loop.us
111111; CHECK: loop.us:
@@ -167,7 +167,7 @@ exit:
167167define void @test_nested_loop (i1 %cond , i32 %N , i1 %arg ) {
168168; CHECK-LABEL: define void @test_nested_loop(i1 %cond, i32 %N, i1 %arg) {
169169; CHECK-NEXT: entry:
170- ; CHECK-NEXT: br i1 %cond, label %entry.split, label %outer_loop.split
170+ ; CHECK-NEXT: br i1 %cond, label %entry.split, label %outer_loop.split, !prof !1
171171; CHECK: entry.split:
172172; CHECK-NEXT: br i1 %arg, label %entry.split.split.us, label %entry.split.split
173173; CHECK: entry.split.split.us:
@@ -238,7 +238,7 @@ exit:
238238define void @test_sibling_loops (i1 %cond1 , i1 %cond2 , i32 %N ) {
239239; CHECK-LABEL: define void @test_sibling_loops(i1 %cond1, i1 %cond2, i32 %N) {
240240; CHECK-NEXT: entry:
241- ; CHECK-NEXT: br i1 %cond1, label %entry.split.us, label %entry.split
241+ ; CHECK-NEXT: br i1 %cond1, label %entry.split.us, label %entry.split, !prof !1
242242; CHECK: entry.split.us:
243243; CHECK-NEXT: br label %loop1.us
244244; CHECK: loop1.us:
@@ -258,7 +258,7 @@ define void @test_sibling_loops(i1 %cond1, i1 %cond2, i32 %N) {
258258; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 false) [ "deopt"() ]
259259; CHECK-NEXT: unreachable
260260; CHECK: between:
261- ; CHECK-NEXT: br i1 %cond2, label %between.split.us2, label %between.split
261+ ; CHECK-NEXT: br i1 %cond2, label %between.split.us2, label %between.split, !prof !1
262262; CHECK: between.split.us2:
263263; CHECK-NEXT: br label %loop2.us
264264; CHECK: loop2.us:
@@ -337,3 +337,9 @@ exit:
337337
338338declare void @may_throw (i32 %i )
339339declare i32 @__CxxFrameHandler3 (...)
340+
341+ !0 = !{!"function_entry_count" , i32 10 }
342+ ;.
343+ ; CHECK: !0 = !{!"function_entry_count", i32 10}
344+ ; CHECK: !1 = !{!"branch_weights", i32 1048575, i32 1}
345+ ;.
0 commit comments