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"

27

28#include

29#include

30

31namespace llvm {

32

37

39

40

41

47

48

51 std::vectorstd::string MAttrs;

54

57 std::optionalCodeModel::Model CodeModel;

63

64

65

67

68

70

71

73

74

76

77

78

80

81

83

84

86

87

88

89

91

92

93

94

96

97

98

99

101

102

103

104

105

107

108

109

110

112

113

114

115

117

118

119

121

122

123

125

126

128

129

131

132

134

135

137

138

139

140

141

143

144

145

146

148

149

151

152

154

155

157

158

159

160

161

162

163

164

165

166

167

168

169

170

172

173

175

176

178

179

181

182

184

185

187

188

190

193

194

196

197

198

199

200

202

203

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

231

232

233

235

236

237

239

240

242

243

245

246

248

249

250

251

253

254

255

256

257

258

259

260

261

262

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

287 bool UseInputModulePath = false,

289};

290

294 : Fn(DiagHandlerFn) {}

296 (*Fn)(DI);

297 return true;

298 }

299};

300

301

302

303

304

306

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

312 }

314};

315

316}

317}

318

319#endif

This file defines the DenseSet and SmallDenseSet classes.

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.

LLVM_ABI void enableDebugTypeODRUniquing()

LLVM_ABI void setDiscardValueNames(bool Discard)

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

LLVM_ABI 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.

An abstract base class for streams implementations that also support a pwrite operation.

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.

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

CodeGenFileType

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

CodeGenOptLevel

Code generation optimization level.

DiagnosticHandler(void *DiagContext=nullptr)

LTO configuration.

Definition Config.h:42

DiagnosticHandlerFunction DiagHandler

Definition Config.h:192

bool HasWholeProgramVisibility

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

Definition Config.h:79

bool ValidateAllVtablesHaveTypeInfos

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

Definition Config.h:82

bool KeepSymbolNameCopies

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

Definition Config.h:95

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

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

Definition Config.h:230

bool DebugPassManager

Whether to emit the pass manager debuggging informations.

Definition Config.h:177

bool AddFSDiscriminator

Add FSAFDO discriminators.

Definition Config.h:195

std::optional< uint64_t > RemarksHotnessThreshold

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

Definition Config.h:171

LLVM_ABI 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.

Definition Config.h:180

ModuleHookFn PreOptModuleHook

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

Definition Config.h:234

CombinedIndexHookFn CombinedIndexHook

Definition Config.h:266

std::optional< CodeModel::Model > CodeModel

Definition Config.h:57

std::string AAPipeline

Definition Config.h:116

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

For adding passes that run right before codegen.

Definition Config.h:55

bool CodeGenOnly

Disable entirely the optimizer, including importing for ThinLTO.

Definition Config.h:69

bool DisableVerify

Definition Config.h:62

std::vector< std::string > MAttrs

Definition Config.h:51

std::vector< std::string > MllvmArgs

Definition Config.h:52

std::vector< std::string > ThinLTOModulesToCompile

Specific thinLTO modules to compile.

Definition Config.h:183

bool VerifyEach

Definition Config.h:61

CodeGenOptLevel CGOptLevel

Definition Config.h:58

PipelineTuningOptions PTO

Tunable parameters for passes in the default pipelines.

Definition Config.h:204

VisScheme

Definition Config.h:43

@ ELF

Definition Config.h:45

@ FromPrevailing

Definition Config.h:44

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...

Definition Config.h:201

bool Dtlto

This flag is used as one of parameters to calculate cache entries and to ensure that in-process cache...

Definition Config.h:100

std::string DefaultTriple

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

Definition Config.h:124

bool AlwaysEmitRegularLTOObj

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

Definition Config.h:90

std::string CPU

Definition Config.h:49

std::string DwoDir

The directory to store .dwo files.

Definition Config.h:136

std::string RemarksFilename

Optimization remarks file path.

Definition Config.h:150

VisScheme VisibilityScheme

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

Definition Config.h:106

ModuleHookFn PostPromoteModuleHook

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

Definition Config.h:238

std::string OverrideTriple

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

Definition Config.h:120

std::string ProfileRemapping

Name remapping file for profile data.

Definition Config.h:133

bool AllVtablesHaveTypeInfos

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

Definition Config.h:85

TargetOptions Options

Definition Config.h:50

std::string SplitDwarfFile

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

Definition Config.h:142

std::string SplitDwarfOutput

The path to write a .dwo file to.

Definition Config.h:147

bool TimeTraceEnabled

Time trace enabled.

Definition Config.h:186

ModuleHookFn PostOptModuleHook

This module hook is called after optimization is complete.

Definition Config.h:247

std::string RemarksPasses

Optimization remarks pass filter.

Definition Config.h:153

std::string OptPipeline

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

Definition Config.h:111

bool RunCSIRInstr

Run PGO context sensitive IR instrumentation.

Definition Config.h:72

ModuleHookFn PostInternalizeModuleHook

This hook is called after internalizing the module.

Definition Config.h:241

unsigned TimeTraceGranularity

Time trace granularity.

Definition Config.h:189

unsigned OptLevel

Definition Config.h:60

ModuleHookFn PostImportModuleHook

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

Definition Config.h:244

bool RemarksWithHotness

Whether to emit optimization remarks with hotness informations.

Definition Config.h:156

std::vector< std::string > PassPlugins

Definition Config.h:53

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).

Definition Config.h:263

std::string CSIRProfile

Context Sensitive PGO profile path.

Definition Config.h:127

ModuleHookFn PreCodeGenModuleHook

This module hook is called before code generation.

Definition Config.h:252

std::optional< Reloc::Model > RelocModel

Definition Config.h:56

bool ShouldDiscardValueNames

Definition Config.h:191

bool PGOWarnMismatch

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

Definition Config.h:75

CodeGenFileType CGFileType

Definition Config.h:59

bool Freestanding

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

Definition Config.h:66

std::string SampleProfile

Sample PGO profile path.

Definition Config.h:130

std::string RemarksFormat

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

Definition Config.h:174

DiagnosticHandlerFunction DiagHandler

Definition Config.h:313

LTOLLVMContext(const Config &C)

Definition Config.h:307

LTOLLVMDiagnosticHandler(DiagnosticHandlerFunction *DiagHandlerFn)

Definition Config.h:293

DiagnosticHandlerFunction * Fn

Definition Config.h:292

bool handleDiagnostics(const DiagnosticInfo &DI) override

Override handleDiagnostics to provide custom implementation.

Definition Config.h:295