LLVM: include/llvm/LTO/Config.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_LTO_CONFIG_H

15#define LLVM_LTO_CONFIG_H

16

18#include "llvm/Config/llvm-config.h"

26

27#include

28#include

29

30namespace llvm {

31

34class ModuleSummaryIndex;

35class raw_pwrite_stream;

36

37namespace lto {

38

39

40

45 };

46

47

50 std::vectorstd::string MAttrs;

53

56 std::optionalCodeModel::Model CodeModel;

62

63

64

66

67

69

70

72

73

75

76

77

79

80

82

83

85

86

87

88

90

91

92

93

95

96

97

98

99

101

102

103

104

106

107

108

109

111

112

113

115

116

117

119

120

122

123

125

126

128

129

131

132

133

134

135

137

138

139

140

142

143

145

146

148

149

151

152

153

154

155

156

157

158

159

160

161

162

163

164

166

167

169

170

172

173

175

176

178

179

181

182

184

187

188

190

191

192

193

194

196

197

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

225

226

227

229

230

231

233

234

236

237

239

240

242

243

244

245

247

248

249

250

251

252

253

254

255

256

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

281 bool UseInputModulePath = false,

283};

284

288 : Fn(DiagHandlerFn) {}

290 (*Fn)(DI);

291 return true;

292 }

293};

294

295

296

297

298

300

305 std::make_unique(&DiagHandler), true);

306 }

308};

309

310}

311}

312

313#endif

This file defines the DenseSet and SmallDenseSet classes.

Machine Check Debug Module

Implements a dense probed hash-table based set.

This is the base abstract class for diagnostic reporting in the backend.

Lightweight error class with error context and mandatory checking.

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

void enableDebugTypeODRUniquing()

void setDiscardValueNames(bool Discard)

Set the Context runtime configuration to discard all value name (but GlobalValue).

void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)

setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...

Class to hold module path string table and global value map, and encapsulate methods for operating on...

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

Tunable parameters for passes in the default pipelines.

PassManager manages ModulePassManagers.

Interfaces for registering analysis passes, producing common pass manager configurations,...

@ C

The default llvm calling convention, compatible with C.

This is an optimization pass for GlobalISel generic memory operations.

CodeGenFileType

These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...

CodeGenOptLevel

Code generation optimization level.

std::function< void(const DiagnosticInfo &)> DiagnosticHandlerFunction

This is the base class for diagnostic handling in LLVM.

DiagnosticHandlerFunction DiagHandler

bool HasWholeProgramVisibility

Asserts whether we can assume whole program visibility during the LTO link.

bool ValidateAllVtablesHaveTypeInfos

We're validating that all native vtables have corresponding type infos.

bool KeepSymbolNameCopies

If true, the LTO instance creates copies of the symbol names for LTO::run.

std::function< bool(unsigned Task, const Module &)> ModuleHookFn

The following callbacks deal with tasks, which normally represent the entire optimization and code ge...

bool DebugPassManager

Whether to emit the pass manager debuggging informations.

bool AddFSDiscriminator

Add FSAFDO discriminators.

std::optional< uint64_t > RemarksHotnessThreshold

The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.

Error addSaveTemps(std::string OutputFileName, bool UseInputModulePath=false, const DenseSet< StringRef > &SaveTempsArgs={})

This is a convenience function that configures this Config object to write temporary files named afte...

std::string StatsFile

Statistics output file path.

ModuleHookFn PreOptModuleHook

This module hook is called after linking (regular LTO) or loading (ThinLTO) the module,...

CombinedIndexHookFn CombinedIndexHook

std::optional< CodeModel::Model > CodeModel

std::function< void(legacy::PassManager &)> PreCodeGenPassesHook

For adding passes that run right before codegen.

bool CodeGenOnly

Disable entirely the optimizer, including importing for ThinLTO.

std::function< bool(const ModuleSummaryIndex &Index, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols)> CombinedIndexHookFn

A combined index hook is called after all per-module indexes have been combined (ThinLTO-specific).

std::vector< std::string > MAttrs

std::vector< std::string > MllvmArgs

std::vector< std::string > ThinLTOModulesToCompile

Specific thinLTO modules to compile.

CodeGenOptLevel CGOptLevel

PipelineTuningOptions PTO

Tunable parameters for passes in the default pipelines.

std::unique_ptr< raw_ostream > ResolutionFile

If this field is set, LTO will write input file paths and symbol resolutions here in llvm-lto2 comman...

std::string DefaultTriple

Setting this field will replace unspecified target triples in input files with this triple.

bool AlwaysEmitRegularLTOObj

Always emit a Regular LTO object even when it is empty because no Regular LTO modules were linked.

std::string DwoDir

The directory to store .dwo files.

std::string RemarksFilename

Optimization remarks file path.

VisScheme VisibilityScheme

Allows non-imported definitions to get the potentially more constraining visibility from the prevaili...

ModuleHookFn PostPromoteModuleHook

This hook is called after promoting any internal functions (ThinLTO-specific).

std::string OverrideTriple

Setting this field will replace target triples in input files with this triple.

std::string ProfileRemapping

Name remapping file for profile data.

bool AllVtablesHaveTypeInfos

If all native vtables have corresponding type infos, allow usage of RTTI to block devirtualization on...

std::string SplitDwarfFile

The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU...

std::string SplitDwarfOutput

The path to write a .dwo file to.

bool TimeTraceEnabled

Time trace enabled.

ModuleHookFn PostOptModuleHook

This module hook is called after optimization is complete.

std::string RemarksPasses

Optimization remarks pass filter.

std::string OptPipeline

If this field is set, the set of passes run in the middle-end optimizer will be the one specified by ...

bool RunCSIRInstr

Run PGO context sensitive IR instrumentation.

ModuleHookFn PostInternalizeModuleHook

This hook is called after internalizing the module.

unsigned TimeTraceGranularity

Time trace granularity.

ModuleHookFn PostImportModuleHook

This hook is called after importing from other modules (ThinLTO-specific).

bool RemarksWithHotness

Whether to emit optimization remarks with hotness informations.

std::vector< std::string > PassPlugins

std::string CSIRProfile

Context Sensitive PGO profile path.

ModuleHookFn PreCodeGenModuleHook

This module hook is called before code generation.

std::optional< Reloc::Model > RelocModel

bool ShouldDiscardValueNames

bool PGOWarnMismatch

Turn on/off the warning about a hash mismatch in the PGO profile data.

CodeGenFileType CGFileType

bool Freestanding

Flag to indicate that the optimizer should not assume builtins are present on the target.

std::string SampleProfile

Sample PGO profile path.

std::string RemarksFormat

The format used for serializing remarks (default: YAML).

A derived class of LLVMContext that initializes itself according to a given Config object.

DiagnosticHandlerFunction DiagHandler

LTOLLVMContext(const Config &C)

LTOLLVMDiagnosticHandler(DiagnosticHandlerFunction *DiagHandlerFn)

DiagnosticHandlerFunction * Fn

bool handleDiagnostics(const DiagnosticInfo &DI) override

Override handleDiagnostics to provide custom implementation.