Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -O2 -pgo-kind=pgo-instr-gen-pipeline -S | FileCheck %s --check-prefix=GEN |
| 2 | ; RUN: opt < %s -O2 -pgo-kind=pgo-instr-gen-pipeline -profile-file=default.profraw -S | FileCheck %s --check-prefix=GEN |
Amy Huang | 7b1d793 | 2019-09-10 23:15:38 +0000 | [diff] [blame] | 3 | target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 4 | target triple = "x86_64-unknown-linux-gnu" |
| 5 | |
| 6 | define i32 @foo(i32 %i) { |
| 7 | entry: |
| 8 | ; GEN: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo |
| 9 | ; GEN-NOT: %pgocount.i = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc__stdin__bar |
| 10 | %call = call i32 @bar() |
| 11 | %add = add nsw i32 %i, %call |
| 12 | ret i32 %add |
| 13 | } |
| 14 | |
| 15 | define internal i32 @bar() { |
| 16 | ; check that bar is inlined into foo and eliminiated from IR. |
| 17 | ; GEN-NOT: define internal i32 @bar |
| 18 | entry: |
| 19 | %call = call i32 (...) @bar1() |
| 20 | ret i32 %call |
| 21 | } |
| 22 | |
| 23 | declare i32 @bar1(...) |