diff options
author | Hongtao Yu <hoy@fb.com> | 2020-08-24 17:52:47 -0700 |
---|---|---|
committer | Hongtao Yu <hoy@fb.com> | 2020-11-30 10:16:54 -0800 |
commit | 64fa8cce225f7d8bd499e3a99caa850b764ff109 (patch) | |
tree | 8bab925cb76b31e53842ea0448a3f04ef92bd954 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7c4555f60d96d8a3ed35d74dab7e591dacc24b8d (diff) | |
download | llvm-64fa8cce225f7d8bd499e3a99caa850b764ff109.zip llvm-64fa8cce225f7d8bd499e3a99caa850b764ff109.tar.gz llvm-64fa8cce225f7d8bd499e3a99caa850b764ff109.tar.bz2 |
[CSSPGO] Pseudo probe instrumentation pass
This change introduces a pseudo probe instrumentation pass for block instrumentation. Please refer to https://reviews.llvm.org/D86193 for the whole story.
Given the following LLVM IR:
```
define internal void @foo2(i32 %x, void (i32)* %f) !dbg !4 {
bb0:
%cmp = icmp eq i32 %x, 0
br i1 %cmp, label %bb1, label %bb2
bb1:
br label %bb3
bb2:
br label %bb3
bb3:
ret void
}
```
The instrumented IR will look like below. Note that each llvm.pseudoprobe intrinsic call represents a pseudo probe at a block, of which the first parameter is the GUID of the probe’s owner function and the second parameter is the probe’s ID.
```
define internal void @foo2(i32 %x, void (i32)* %f) !dbg !4 {
bb0:
%cmp = icmp eq i32 %x, 0
call void @llvm.pseudoprobe(i64 837061429793323041, i64 1)
br i1 %cmp, label %bb1, label %bb2
bb1:
call void @llvm.pseudoprobe(i64 837061429793323041, i64 2)
br label %bb3
bb2:
call void @llvm.pseudoprobe(i64 837061429793323041, i64 3)
br label %bb3
bb3:
call void @llvm.pseudoprobe(i64 837061429793323041, i64 4)
ret void
}
```
Reviewed By: wmi
Differential Revision: https://reviews.llvm.org/D86499
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions