This is an archive of the discontinued LLVM Phabricator instance.

[CSSPGO] Turn on profi and ext-tsp when using probe-based profile.
ClosedPublic

Authored by hoy on Mar 24 2022, 4:30 PM.

Details

Summary

Probe-based profile leads to a better performance when combined with profi and ext-tsp block layout. I'm turning them on by default.

Diff Detail

Event Timeline

hoy created this revision.Mar 24 2022, 4:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 4:30 PM
hoy requested review of this revision.Mar 24 2022, 4:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 4:30 PM
wenlei added inline comments.Mar 24 2022, 4:34 PM
llvm/lib/Transforms/IPO/SampleProfile.cpp
2036–2043

I would structure it slightly differently..

if (Reader->profileIsCSFlat() || Reader->profileIsCSNested() || Reader->profileIsProbeBased()) {
    // Enable iterative-BFI by default for CSSPGO.
    if (!UseIterativeBFIInference.getNumOccurrences())
      UseIterativeBFIInference = true;
    // Enable Profi by default for CSSPGO.
    if (!SampleProfileUseProfi.getNumOccurrences())
      SampleProfileUseProfi = true;

    // Enable EXT-TSP block layout for CSSPGO.
    if (!EnableExtTspBlockPlacement.getNumOccurrences())
      EnableExtTspBlockPlacement = true;
}
else if (Reader->profileIsCSNested() || Reader->profileIsProbeBased()) {
  ...
}
hoy updated this revision to Diff 418084.Mar 24 2022, 4:44 PM

Updating D122442: [CSSPGO] Turn on profi and ext-tsp when using probe-based profile.

hoy added inline comments.Mar 24 2022, 4:45 PM
llvm/lib/Transforms/IPO/SampleProfile.cpp
2036–2043

Sounds good without the else.

wenlei accepted this revision.Mar 24 2022, 5:35 PM

lgtm, thanks.

This revision is now accepted and ready to land.Mar 24 2022, 5:35 PM
hoy updated this revision to Diff 418099.Mar 24 2022, 6:09 PM

Fixing test failures by explictly turning off profi.