LLVM: include/llvm/Analysis/StaticDataProfileInfo.h Source File (original) (raw)

1#ifndef LLVM_ANALYSIS_STATICDATAPROFILEINFO_H

2#define LLVM_ANALYSIS_STATICDATAPROFILEINFO_H

3

10

11namespace llvm {

12

14

15

16

23

25

26

27

29}

30

31

32

34public:

35

36

37

38

39

41

42

43

45

46

47 LLVM_ABI std::optional<uint64_t>

49

50

51

57

58

59

62

63

65 std::optional SectionPrefix) const;

66

67

69

71

72public:

75

76

77

78

79

81 std::optional<uint64_t> Count);

82

83

84

85

86

89};

90

91

92

94public:

95 static char ID;

99

104

105

106

110

111private:

112 std::unique_ptr Info;

113};

114

115}

116

117#endif

Analysis containing CSE Info

This file defines the DenseMap class.

This file defines the DenseSet and SmallDenseSet classes.

Represent the analysis usage information of a pass.

void setPreservesAll()

Set by analyses that do not transform their input at all.

This is an important base class in LLVM.

Implements a dense probed hash-table based set.

A Module instance is used to store all the information related to an LLVM module.

Analysis providing profile information.

bool doFinalization(Module &M) override

doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...

const StaticDataProfileInfo & getStaticDataProfileInfo() const

Definition StaticDataProfileInfo.h:101

void getAnalysisUsage(AnalysisUsage &AU) const override

This pass provides StaticDataProfileInfo for reads/writes but does not modify M or other analysis.

Definition StaticDataProfileInfo.h:107

static char ID

Definition StaticDataProfileInfo.h:95

bool doInitialization(Module &M) override

doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...

StaticDataProfileInfoWrapperPass()

StaticDataProfileInfo & getStaticDataProfileInfo()

Definition StaticDataProfileInfo.h:100

A class that holds the constants that represent static data and their profile information and provide...

Definition StaticDataProfileInfo.h:33

LLVM_ABI std::optional< uint64_t > getConstantProfileCount(const Constant *C) const

If C has a count, return it. Otherwise, return std::nullopt.

LLVM_ABI StaticDataHotness getConstantHotnessUsingProfileCount(const Constant *C, const ProfileSummaryInfo *PSI, uint64_t Count) const

Return the hotness of the constant C based on its profile count Count.

LLVM_ABI StringRef hotnessToStr(StaticDataHotness Hotness) const

Return the string representation of the hotness enum Hotness.

StaticDataHotness

Use signed enums for enum value comparison, and make 'LukewarmOrUnknown' as 0 so any accidentally uni...

Definition StaticDataProfileInfo.h:52

@ Cold

Definition StaticDataProfileInfo.h:53

@ Hot

Definition StaticDataProfileInfo.h:55

@ LukewarmOrUnknown

Definition StaticDataProfileInfo.h:54

bool EnableDataAccessProf

Definition StaticDataProfileInfo.h:70

LLVM_ABI void addConstantProfileCount(const Constant *C, std::optional< uint64_t > Count)

If Count is not nullopt, add it to the profile count of the constant C in a saturating way,...

LLVM_ABI StringRef getConstantSectionPrefix(const Constant *C, const ProfileSummaryInfo *PSI) const

Given a constant C, returns a section prefix.

LLVM_ABI StaticDataHotness getSectionHotnessUsingDataAccessProfile(std::optional< StringRef > SectionPrefix) const

Return the hotness based on section prefix SectionPrefix.

StaticDataProfileInfo(bool EnableDataAccessProf)

Definition StaticDataProfileInfo.h:73

DenseMap< const Constant *, uint64_t > ConstantProfileCounts

A constant is tracked only if the following conditions are met.

Definition StaticDataProfileInfo.h:40

DenseSet< const Constant * > ConstantWithoutCounts

Keeps track of the constants that are seen at least once without profile counts.

Definition StaticDataProfileInfo.h:44

StringRef - Represent a constant reference to a string, i.e.

@ C

The default llvm calling convention, compatible with C.

AnnotationKind

Definition StaticDataProfileInfo.h:17

@ DeclForLinker

Definition StaticDataProfileInfo.h:19

@ ExplicitSection

Definition StaticDataProfileInfo.h:20

@ ReservedName

Definition StaticDataProfileInfo.h:21

@ AnnotationOK

Definition StaticDataProfileInfo.h:18

AnnotationKind getAnnotationKind(const GlobalVariable &GV)

Returns the annotation kind of the global variable GV.

bool IsAnnotationOK(const GlobalVariable &GV)

Returns true if the annotation kind of the global variable GV is AnnotationOK.

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr Count