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

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_ANALYSIS_OPTIMIZATIONREMARKEMITTER_H

15#define LLVM_ANALYSIS_OPTIMIZATIONREMARKEMITTER_H

16

22#include

23

24namespace llvm {

25

26

27

28

29

30

31

33public:

35 : F(F), BFI(BFI) {}

36

37

38

39

40

41

42

43

44

45

46

47

49

51 : F(Arg.F), BFI(Arg.BFI) {}

52

54 F = RHS.F;

55 BFI = RHS.BFI;

56 return *this;

57 }

58

59

62

63

67 }

68

69

70

72

73

74

75 template

76 void emit(T RemarkBuilder, decltype(RemarkBuilder()) * = nullptr) {

77

78

79

80

82 auto R = RemarkBuilder();

83 static_assert(

85 "the lambda passed to emit() must return a remark");

87 }

88 }

89

90

91

92

93

94

95

96

99 }

102 }

106 }

107

108private:

110

112

113

114 std::unique_ptr OwnedBFI;

115

116

117

118 std::optional<uint64_t> computeHotness(const Value *V);

119

120

122

123

124

125 bool shouldEmitVerbose() { return BFI != nullptr; }

126

127 OptimizationRemarkEmitter(const OptimizationRemarkEmitter &) = delete;

128 void operator=(const OptimizationRemarkEmitter &) = delete;

129};

130

131

132

133

134namespace ore {

138}

139

140

141

142

143

144

146 std::unique_ptr ORE;

147

148public:

150

152

154

156 assert(ORE && "pass not run yet");

157 return *ORE;

158 }

159

161};

162

167

168public:

169

171

172

174};

175}

176#endif

Given that RA is a live value

This header defines various interfaces for pass management in LLVM.

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

static const char PassName[]

API to communicate dependencies between analyses during invalidation.

A container for analyses that lazily runs them and caches their results.

Represent the analysis usage information of a pass.

BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...

Common features for diagnostics dealing with optimization remarks that are used by IR passes.

Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...

FunctionPass class - This class is used to implement most global optimizations.

LLVMContext & getContext() const

getContext - Return a reference to the LLVMContext associated with this function.

This is an important class for using LLVM in a threaded context.

const DiagnosticHandler * getDiagHandlerPtr() const

getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.

LLVMRemarkStreamer * getLLVMRemarkStreamer()

The "LLVM remark streamer" used by LLVM to serialize remark diagnostics comming from IR and MIR passe...

A set of analyses that are preserved following a run of a transformation pass.

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

LLVM Value Representation.

This is an optimization pass for GlobalISel generic memory operations.

A CRTP mix-in that provides informational APIs needed for analysis passes.

A special type used by analysis passes to provide an address that identifies that particular analysis...

bool isAnyRemarkEnabled(StringRef PassName) const

Return true if any type of remarks are enabled for this pass.

Used in the streaming interface as the general argument type.

Used to set IsVerbose via the stream interface.