[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Sergey Pupyrev via Phabricator via cfe-commits
spupyrev added a comment.

Thanks @HaoyuZhang for adding the flag and the documentation. I just edited the 
message a bit; otherwise looks good.




Comment at: clang/docs/UsersManual.rst:2244
 
+  [OPTIONAL] During the sampling, the profiles may have errors or missing
+  blocks. Profi (profile inference) algorithm can infer block and edge counts

[OPTIONAL] Sampling-based profiles can have inaccuracies or missing block/edge
counters. The profile inference algorithm (profi) can be used to infer missing 
block and edge counts and improve the quality of profile data. To apply the
optimization, add an extra flag ``-fsample-profile-use-profi`` to the command 
line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136846

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D109531: [CSSPGO] Enable pseudo probe instrumentation in O0 mode.

2021-09-10 Thread Sergey Pupyrev via Phabricator via cfe-commits
spupyrev added a comment.

In D109531#2993394 , @wmi wrote:

> In D109531#2992721 , @hoy wrote:
>
>> In D109531#2992702 , @wenlei wrote:
>>
>>> The change makes sense given instr PGO also happens for O0. But 
>>> practically, if a file is being built with O0, do we care about its profile 
>>> given we're not really optimizing it anyways? Functions from O0 modules are 
>>> not supposed to be inlined into O1 
>>> + modules either.
>>
>> We probably don't care about performance for O0 build. The change is for 
>> consistency, also makes the compiler happy which otherwise will complain 
>> about "Pseudo-probe-based profile requires SampleProfileProbePass" for O0 
>> modules that don't have probes.
>
> The complain message is emitted in SampleProfileLoader::doInitialization. 
> llvm will not run SampleProfileLoader pass for O0 module. Why there is the 
> complain?

We've encountered this exception while building an old version of gcc (8.3) 
with llvm-12. As Hongtao pointed out, they sometimes try to build targets with 
"-flto" but without "-O2/O3 ". 
Surely, the right "fix" would be to modify the gcc build scripts (which is 
possibly already done in later gcc releases); this workaround is to make sure 
we can also process "incorrect" builds.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109531

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits