hoy added a comment.

In D109531#2994823 <https://reviews.llvm.org/D109531#2994823>, @wmi wrote:

> In D109531#2993484 <https://reviews.llvm.org/D109531#2993484>, @hoy wrote:
>
>> In D109531#2993394 <https://reviews.llvm.org/D109531#2993394>, @wmi wrote:
>>
>>> In D109531#2992721 <https://reviews.llvm.org/D109531#2992721>, @hoy wrote:
>>>
>>>> In D109531#2992702 <https://reviews.llvm.org/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 
>>>>> <https://reviews.llvm.org/owners/package/1/>+ 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?
>>
>> Good question. It could happen in lto postlink which by default optimizes in 
>> -O2 mode. More specifically, with the following command, both `cc1` and 
>> `lld` will run in default mode, which is -O0 for cc1 and -O2 for lld.
>>
>>   clang -flto 1.cpp -v -fuse-ld=lld
>
> I see. It seems a problem only exposed in monolithic lto. Could you add some 
> comment before the change in PassBuilder.cpp?

Sounds good, comment added.  Actually this can also happen in thinlto. Having 
probe inserted in O0 mode allows users to switch between arbitrary setups.


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

Reply via email to