This is an archive of the discontinued LLVM Phabricator instance.

[FS-AFDO] Clean up non-zero discriminator for pseudo probes at the first FS discriminator pass.
ClosedPublic

Authored by hoy on May 16 2023, 5:30 PM.

Details

Summary

The dwarf discriminator field for pseudo probes is not supposed to be used until the first FS discriminator pass. Unfortunately there are always corner cases that accidientally set this field. For example, the inliner could set this field for an inlined instruction if the instruction does not come with any debug information. While fixing all such spots is possible, but for future-proff I'd like to enforce a general cleanup before assigning probes any FS discriminator.

Diff Detail

Event Timeline

hoy created this revision.May 16 2023, 5:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2023, 5:30 PM
hoy requested review of this revision.May 16 2023, 5:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2023, 5:30 PM
hoy edited the summary of this revision. (Show Details)
hoy added reviewers: wenlei, xur.
wenlei added inline comments.May 16 2023, 5:36 PM
llvm/test/CodeGen/X86/fsafdo_probe.ll
68–69

why is this test change? If anything, I was expecting non-zero -> zero for probe discriminators..

hoy added inline comments.May 16 2023, 5:41 PM
llvm/test/CodeGen/X86/fsafdo_probe.ll
68–69

This is to test the non-zero discriminator can be cleaned up by the first FS discriminator pass.

wenlei added inline comments.May 16 2023, 5:45 PM
llvm/test/CodeGen/X86/fsafdo_probe.ll
68–69

Oh, I see. Can you maybe add a comment? Is the "from 0 -> xxx" covering the check on clean up non-zero discriminator?

hoy added inline comments.May 16 2023, 5:49 PM
llvm/test/CodeGen/X86/fsafdo_probe.ll
68–69

Done.

hoy updated this revision to Diff 522859.May 16 2023, 5:49 PM
hoy edited the summary of this revision. (Show Details)

Updating D150741: [FS-AFDO] Clean up non-zero discriminator for pseudo probes at the first FS discriminator pass.

wenlei accepted this revision.May 16 2023, 6:30 PM
This revision is now accepted and ready to land.May 16 2023, 6:30 PM
This revision was landed with ongoing or failed builds.May 16 2023, 9:35 PM
This revision was automatically updated to reflect the committed changes.