This is an archive of the discontinued LLVM Phabricator instance.

[Sample-PGO] Emit FS discriminators only when -fdebug-info-for-profiling is set
ClosedPublic

Authored by xur on Feb 24 2022, 9:49 PM.

Details

Summary

IR level addDiscriminator pass is guarded by DebugInfoForProfiling (set by option -fdebug-info-for-profiling).

This patch syncs the logic for the MIR and IR level implementations.

Diff Detail

Event Timeline

xur created this revision.Feb 24 2022, 9:49 PM
xur requested review of this revision.Feb 24 2022, 9:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2022, 9:49 PM
wenlei accepted this revision.Feb 24 2022, 9:51 PM

lgtm, thanks.

This revision is now accepted and ready to land.Feb 24 2022, 9:51 PM
xur added a comment.Feb 24 2022, 9:54 PM

Another way to do this is to check PGOOpt->DebugInfoForProfiling in TargetPassConfig before adding the passes.
That would be the same as IR level addDiscriminator.

But since PGOOpt might not be set for some invocations (like in the unit tests). I would need to introduce
an extra internal option.

I think the change is this patch is simpler.

hoy accepted this revision.Feb 24 2022, 10:00 PM
This revision was landed with ongoing or failed builds.Feb 25 2022, 9:41 AM
This revision was automatically updated to reflect the committed changes.