]
; CHECK: entry.sw.bb3_crit_edge1:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 1)
; CHECK: br label %sw.bb3
; CHECK: entry.sw.bb3_crit_edge:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 0)
; CHECK: br label %sw.bb3
sw.bb:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 5)
%call = call i32 @_ZL3bari(i32 2)
br label %sw.epilog
sw.bb1:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 4)
%call2 = call i32 @_ZL3bari(i32 1024)
br label %sw.epilog
br i1 %cmp, label %if.then, label %if.end
if.then:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 2)
%call4 = call i32 @_ZL3bari(i32 4)
br label %return
if.end:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 3)
%call5 = call i32 @_ZL3bari(i32 8)
br label %sw.epilog
sw.default:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 6)
%call6 = call i32 @_ZL3bari(i32 32)
%cmp7 = icmp sgt i32 %j, 10
br i1 %cmp7, label %if.then8, label %if.end9
if.then8:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 7)
%add = add nsw i32 %call6, 10
br label %if.end9
define internal i32 @_ZL3bari(i32 %i) {
entry:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"__llvm_profile_name_<stdin>:_ZL3bari", i32 0, i32 0), i64 12884901887, i32 1, i32 0)
ret i32 %i
}
; CHECK: i32 4, label %entry.sw.bb3_crit_edge1
i32 5, label %sw.bb3
]
-; CHECK: !prof !0
+; CHECK: !prof !
; CHECK: entry.sw.bb3_crit_edge1:
; CHECK: br label %sw.bb3
sw.bb3:
%cmp = icmp eq i32 %j, 2
br i1 %cmp, label %if.then, label %if.end
-; CHECK: !prof !1
+; CHECK: !prof !
if.then:
%call4 = call i32 @_ZL3bari(i32 4)
%call6 = call i32 @_ZL3bari(i32 32)
%cmp7 = icmp sgt i32 %j, 10
br i1 %cmp7, label %if.then8, label %if.end9
-; CHECK: !prof !2
+; CHECK: !prof !
if.then8:
%add = add nsw i32 %call6, 10
ret i32 %i
}
-; CHECK: !0 = !{!"branch_weights", i32 2, i32 1, i32 0, i32 2, i32 1, i32 1}
-; CHECK: !1 = !{!"branch_weights", i32 2, i32 2}
-; CHECK: !2 = !{!"branch_weights", i32 1, i32 1}
+; CHECK-DAG: !{!"branch_weights", i32 2, i32 2}
+; CHECK-DAG: !{!"branch_weights", i32 1, i32 1}
define i32 @_Z15test_nested_foriii(i32 %r, i32 %s, i32 %t) {
entry:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 3)
br label %for.cond
for.cond:
br label %for.inc
for.inc:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 0)
%inc7 = add nsw i32 %k.0, 1
br label %for.cond4
br label %for.inc8
for.inc8:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 1)
%inc9 = add nsw i32 %j.0, 1
br label %for.cond1
for.end10:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 2)
br label %for.inc11
for.inc11:
%nested_for_sum.0 = phi i32 [ 1, %entry ], [ %nested_for_sum.1, %for.inc11 ]
%cmp = icmp slt i32 %i.0, %r
br i1 %cmp, label %for.body, label %for.end13
-; CHECK: !prof !0
+; CHECK: !prof
for.body:
br label %for.cond1
%nested_for_sum.1 = phi i32 [ %nested_for_sum.0, %for.body ], [ %nested_for_sum.2, %for.inc8 ]
%cmp2 = icmp slt i32 %j.0, %s
br i1 %cmp2, label %for.body3, label %for.end10
-; CHECK: !prof !1
+; CHECK: !prof
for.body3:
br label %for.cond4
%nested_for_sum.2 = phi i32 [ %nested_for_sum.1, %for.body3 ], [ %inc, %for.inc ]
%cmp5 = icmp slt i32 %k.0, %t
br i1 %cmp5, label %for.body6, label %for.end
-; CHECK: !prof !2
+; CHECK: !prof
for.body6:
%inc = add nsw i32 %nested_for_sum.2, 1
ret i32 %nested_for_sum.0
}
-; CHECK: !0 = !{!"branch_weights", i32 10, i32 6}
-; CHECK: !1 = !{!"branch_weights", i32 33, i32 10}
-; CHECK: !2 = !{!"branch_weights", i32 186, i32 33}
+; CHECK: !{!"branch_weights"
-; RUN: not opt < %s -pgo-instr-use -pgo-profile-file=%T/notexisting.profdata -S 2>&1 |grep 'notexisting.profdata: No such file or directory'
+; RUN: not opt < %s -pgo-instr-use -pgo-profile-file=%T/notexisting.profdata -S
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
]
sw.bb:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 2)
%add = add nsw i32 %i, 2
br label %sw.epilog
sw.bb1:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 0)
%add2 = add nsw i32 %i, 100
br label %sw.epilog
sw.bb3:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 1)
%add4 = add nsw i32 %i, 4
br label %sw.epilog
sw.default:
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 3)
%add5 = add nsw i32 %i, 1
br label %sw.epilog
ret i32 %retv
}
-;CHECK: !0 = !{!"branch_weights", i32 3, i32 0, i32 0, i32 0}
+; CHECK: !0 = !{!"branch_weights"