1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/test/Transforms/PGOProfile/noprofile.ll
Petr Hosek 3cfd18b793 Support for instrumenting only selected files or functions
This change implements support for applying profile instrumentation
only to selected files or functions. The implementation uses the
sanitizer special case list format to select which files and functions
to instrument, and relies on the new noprofile IR attribute to exclude
functions from instrumentation.

Differential Revision: https://reviews.llvm.org/D94820
2021-01-26 17:13:34 -08:00

26 lines
616 B
LLVM

; RUN: opt < %s -pgo-instr-gen -S | FileCheck %s
; RUN: opt < %s -passes=pgo-instr-gen -S | FileCheck %s
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@i = dso_local global i32 0, align 4
define i32 @test1() {
entry:
; CHECK: call void @llvm.instrprof.increment
%0 = load i32, i32* @i, align 4
%add = add i32 %0, 1
ret i32 %add
}
define i32 @test2() #0 {
entry:
; CHECK-NOT: call void @llvm.instrprof.increment
%0 = load i32, i32* @i, align 4
%sub = sub i32 %0, 1
ret i32 %sub
}
attributes #0 = { noprofile }