[PATCH] D89723: [CSSPGO][llvm-profgen]Context-sensitive profile data generation

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 15:37:13 PDT 2020


wmi added inline comments.


================
Comment at: llvm/test/tools/llvm-profgen/noinline-cs-noprobe.test:7
+; CHECK: 3: 1756 bar:1745
+; CHECK:[main:1 @ foo:3 @ bar]:29103:1745
+; CHECK: 0: 1745
----------------
wenlei wrote:
> wmi wrote:
> > Is it possible for us to tell one level in context is inlined or not? It will make the profile more informative. 
> Yes, agree that can useful, especially for tuning purpose to see how CS inline decision differs from previous build. We wanted to add a metadata (similar to `!CFGChecksum` for pseudo-probe profile) to indicate whether a context is inlined or not. Note that in this case, it would only tell whether bar is inlined along `main:1 @ foo:3`, but not whether `foo` is inlined along `main:1.` What do you think?
> 
> Also to keep patch smallish, I think we can add this later separately. 
> 
> ```
> [main:1 @ foo:3 @ bar]:29103:1745
>   ...
>   ...
> !CFGChecksum: ...
> !Flag: Inline
> 
> ```
> 
> 
> Note that in this case, it would only tell whether bar is inlined along main:1 @ foo:3, but not whether foo is inlined along main:1. What do you think?

What is the main difficulty to keep the inline information for each Context level? 

> Also to keep patch smallish, I think we can add this later separately.

Sure.

```
> [main:1 @ foo:3 @ bar]:29103:1745
!CFGChecksum: ...
!Flag: Inline
```

Can we use some special sign to mark whether bar is inline or not, "*" for example?
```
[main:1 @ foo:3 @ bar*]:29103:1745
```


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:308-310
+  // Filter out broken stack sample. We may not have complete frame info
+  // if sample end up in prolog/epilog, the result is dangling context not
+  // connected to entry point. This should be relatively rare thus not much
----------------
hoy wrote:
> wmi wrote:
> > What sampling event are you using? If br_inst_retired:near_taken is used, the sample won't end up in prolog/epilog.
> Yes, we are sampling the br_inst_retired:near_taken event. Normally there will be no branch instructions in a prolog. This deals with a weird case where a branch instruction ends up in a shrink-wrapped prolog.
I see. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89723/new/

https://reviews.llvm.org/D89723



More information about the llvm-commits mailing list