Skip to content
Snippets Groups Projects
Commit 9a2ce250 authored by Dehao Chen's avatar Dehao Chen
Browse files

Revert r307445 as it breaks on certain platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307449 91177308-0d34-0410-b5e6-96231b3b80d8
parent ad020925
No related branches found
No related tags found
No related merge requests found
bar:1000:1000 bar:100:100
1: 1000 1: 2000
2: 0
foo:1000:1000
1:bar:1000
1: 1000
2: 1000
// Test if PGO sample use passes are invoked. // Test if PGO sample use passes are invoked.
// //
// Ensure Pass SampleProfileLoader is invoked. // Ensure Pass PGOInstrumentationGenPass is invoked.
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=STRUCTURE // RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -mllvm -inline-threshold=0 -emit-llvm -o - 2>&1 | FileCheck %s // CHECK: Remove unused exception handling info
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -mllvm -debug-pass=Structure -mllvm -inline-threshold=0 -emit-llvm -fexperimental-new-pass-manager -o - 2>&1 | FileCheck %s // CHECK: Sample profile pass
// STRUCTURE: Remove unused exception handling info
// STRUCTURE: Sample profile pass
void baz();
// CHECK-LABEL: @callee(
void callee(int t) {
for (int i = 0; i < t; i++)
baz();
}
// CHECK-LABEL: @bar(
// cold call to callee should not be inlined.
// CHECK: call void @callee
void bar(int x) {
if (x < 100)
callee(x);
}
// CHECK-LABEL: @foo(
// bar should be early-inlined because it is hot inline instance in profile.
// callee should be inlined because it is hot callsite in the inline instance
// of foo:bar.
// CHECK-NOT: call void @callee
// CHECK-NOT: call void @bar
void foo(int x) {
bar(x);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment