This is an archive of the discontinued LLVM Phabricator instance.

[profi][NFC] Get rid of afdo_detail::TypeMap
ClosedPublic

Authored by Amir on Jun 5 2023, 12:14 PM.

Details

Summary

Parametrize SampleProfileInference and SampleProfileLoaderBaseImpl by function
type (Function/MachineFunction) instead of block type
(BasicBlock/MachineBasicBlock). Move out specializations to appropriate
locations.

This change makes it possible to use GraphTraits instead of a custom TypeMap and
make SampleProfileInference not dependent on LLVM types, paving the way for
generalizing SampleProfileInference interfaces to BOLT IR types
(BinaryFunction/BinaryBasicBlock) in stale profile matching (D144500).

Diff Detail

Event Timeline

Amir created this revision.Jun 5 2023, 12:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 12:14 PM
Amir requested review of this revision.Jun 5 2023, 12:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 12:14 PM
Amir edited the summary of this revision. (Show Details)
hoy accepted this revision.Jun 6 2023, 12:46 PM
hoy added inline comments.
llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
119

nit: rename BT to FT, which stands for function type

This revision is now accepted and ready to land.Jun 6 2023, 12:46 PM
This revision was automatically updated to reflect the committed changes.
Amir marked an inline comment as done.Jun 6 2023, 1:49 PM