| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5 |
| ; There is no profile, but that's OK because the prelink does not care about |
| ; the content of the profile, just that we intend to use one. |
| ; There is no scenario currently of doing ctx profile use without thinlto. |
| ; |
| ; RUN: opt -passes='thinlto-pre-link<O2>' -use-ctx-profile=something_that_does_not_exist %s -S | FileCheck %s |
| ; RUN: opt -debug-info-for-profiling -passes='thinlto-pre-link<O2>' -use-ctx-profile=something_that_does_not_exist %s -S | FileCheck %s |
| |
| declare void @bar() |
| |
| define void @foo(i32 %a, ptr %fct) { |
| ; CHECK-LABEL: define void @foo( |
| ; CHECK-SAME: i32 [[A:%.*]], ptr [[FCT:%.*]]) local_unnamed_addr !guid [[META0:![0-9]+]] { |
| ; CHECK-NEXT: call void @llvm.instrprof.increment(ptr @foo, i64 728453322856651412, i32 2, i32 0) |
| ; CHECK-NEXT: [[T:%.*]] = icmp eq i32 [[A]], 0 |
| ; CHECK-NEXT: br i1 [[T]], label %[[YES:.*]], label %[[NO:.*]] |
| ; CHECK: [[YES]]: |
| ; CHECK-NEXT: call void @llvm.instrprof.increment(ptr @foo, i64 728453322856651412, i32 2, i32 1) |
| ; CHECK-NEXT: call void @llvm.instrprof.callsite(ptr @foo, i64 728453322856651412, i32 2, i32 0, ptr [[FCT]]) |
| ; CHECK-NEXT: call void [[FCT]](i32 0) |
| ; CHECK-NEXT: br label %[[EXIT:.*]] |
| ; CHECK: [[NO]]: |
| ; CHECK-NEXT: call void @llvm.instrprof.callsite(ptr @foo, i64 728453322856651412, i32 2, i32 1, ptr @bar) |
| ; CHECK-NEXT: call void @bar() |
| ; CHECK-NEXT: br label %[[EXIT]] |
| ; CHECK: [[EXIT]]: |
| ; CHECK-NEXT: ret void |
| ; |
| %t = icmp eq i32 %a, 0 |
| br i1 %t, label %yes, label %no |
| yes: |
| call void %fct(i32 %a) |
| br label %exit |
| no: |
| call void @bar() |
| br label %exit |
| exit: |
| ret void |
| } |
| ;. |
| ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind } |
| ;. |
| ; CHECK: [[META0]] = !{i64 6699318081062747564} |
| ;. |