HomePhabricator

[Remarks][2/2] Expand remarks hotness threshold option support in more tools

Authored by weiwang on Nov 17 2020, 10:43 AM.

Description

[Remarks][2/2] Expand remarks hotness threshold option support in more tools

This is the #2 of 2 changes that make remarks hotness threshold option
available in more tools. The changes also allow the threshold to sync with
hotness threshold from profile summary with special value 'auto'.

This change expands remarks hotness threshold option
-fdiagnostics-hotness-threshold in clang and *-remarks-hotness-threshold in
other tools to utilize hotness threshold from profile summary.

Remarks hotness filtering relies on several driver options. Table below lists
how different options are correlated and affect final remarks outputs:

profilehotnessthresholdremarks printed
NoNoNoAll
NoNoYesNone
NoYesNoAll
NoYesYesNone
YesNoNoAll
YesNoYesNone
YesYesNoAll
YesYesYes>=threshold

In the presence of profile summary, it is often more desirable to directly use
the hotness threshold from profile summary. The new argument value 'auto'
indicates threshold will be synced with hotness threshold from profile summary
during compilation. The "auto" threshold relies on the availability of profile
summary. In case of missing such information, no remarks will be generated.

Differential Revision: https://reviews.llvm.org/D85808