LLVM  14.0.0git
LTOCodeGenerator.cpp
Go to the documentation of this file.
1 //===-LTOCodeGenerator.cpp - LLVM Link Time Optimizer ---------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the Link Time Optimization library. This library is
10 // intended to be used by linker to optimize code at link time.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 
16 #include "llvm/ADT/Statistic.h"
17 #include "llvm/ADT/StringExtras.h"
18 #include "llvm/Analysis/Passes.h"
24 #include "llvm/Config/config.h"
25 #include "llvm/IR/Constants.h"
26 #include "llvm/IR/DataLayout.h"
27 #include "llvm/IR/DebugInfo.h"
28 #include "llvm/IR/DerivedTypes.h"
29 #include "llvm/IR/DiagnosticInfo.h"
31 #include "llvm/IR/LLVMContext.h"
34 #include "llvm/IR/Mangler.h"
35 #include "llvm/IR/Module.h"
36 #include "llvm/IR/PassTimingInfo.h"
37 #include "llvm/IR/Verifier.h"
38 #include "llvm/InitializePasses.h"
39 #include "llvm/LTO/LTO.h"
40 #include "llvm/LTO/LTOBackend.h"
43 #include "llvm/Linker/Linker.h"
44 #include "llvm/MC/MCAsmInfo.h"
45 #include "llvm/MC/MCContext.h"
47 #include "llvm/MC/TargetRegistry.h"
51 #include "llvm/Support/Host.h"
53 #include "llvm/Support/Signals.h"
59 #include "llvm/Transforms/IPO.h"
65 #include <system_error>
66 using namespace llvm;
67 
69 #ifdef LLVM_VERSION_INFO
70  return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
71 #else
72  return PACKAGE_NAME " version " PACKAGE_VERSION;
73 #endif
74 }
75 
76 namespace llvm {
78  "lto-discard-value-names",
79  cl::desc("Strip names from Value during LTO (other than GlobalValue)."),
80 #ifdef NDEBUG
81  cl::init(true),
82 #else
83  cl::init(false),
84 #endif
85  cl::Hidden);
86 
88  "lto-pass-remarks-with-hotness",
89  cl::desc("With PGO, include profile count in optimization remarks"),
90  cl::Hidden);
91 
94  "lto-pass-remarks-hotness-threshold",
95  cl::desc("Minimum profile count required for an "
96  "optimization remark to be output."
97  " Use 'auto' to apply the threshold from profile summary."),
98  cl::value_desc("uint or 'auto'"), cl::init(0), cl::Hidden);
99 
101  RemarksFilename("lto-pass-remarks-output",
102  cl::desc("Output filename for pass remarks"),
103  cl::value_desc("filename"));
104 
106  RemarksPasses("lto-pass-remarks-filter",
107  cl::desc("Only record optimization remarks from passes whose "
108  "names match the given regular expression"),
109  cl::value_desc("regex"));
110 
112  "lto-pass-remarks-format",
113  cl::desc("The format used for serializing remarks (default: YAML)"),
114  cl::value_desc("format"), cl::init("yaml"));
115 
117  "lto-stats-file",
118  cl::desc("Save statistics to the specified file"),
119  cl::Hidden);
120 }
121 
123  : Context(Context), MergedModule(new Module("ld-temp.o", Context)),
124  TheLinker(new Linker(*MergedModule)) {
125  Context.setDiscardValueNames(LTODiscardValueNames);
126  Context.enableDebugTypeODRUniquing();
127 
128  Config.CodeModel = None;
129  Config.StatsFile = LTOStatsFile;
130  Config.PreCodeGenPassesHook = [](legacy::PassManager &PM) {
131  PM.add(createObjCARCContractPass());
132  };
133 }
134 
136 
138  for (const StringRef &Undef : Mod->getAsmUndefinedRefs())
139  AsmUndefinedRefs.insert(Undef);
140 }
141 
143  assert(&Mod->getModule().getContext() == &Context &&
144  "Expected module in same context");
145 
146  bool ret = TheLinker->linkInModule(Mod->takeModule());
148 
149  // We've just changed the input, so let's make sure we verify it.
150  HasVerifiedInput = false;
151 
152  return !ret;
153 }
154 
155 void LTOCodeGenerator::setModule(std::unique_ptr<LTOModule> Mod) {
156  assert(&Mod->getModule().getContext() == &Context &&
157  "Expected module in same context");
158 
159  AsmUndefinedRefs.clear();
160 
161  MergedModule = Mod->takeModule();
162  TheLinker = std::make_unique<Linker>(*MergedModule);
164 
165  // We've just changed the input, so let's make sure we verify it.
166  HasVerifiedInput = false;
167 }
168 
170  Config.Options = Options;
171 }
172 
174  switch (Debug) {
176  EmitDwarfDebugInfo = false;
177  return;
178 
180  EmitDwarfDebugInfo = true;
181  return;
182  }
183  llvm_unreachable("Unknown debug format!");
184 }
185 
187  Config.OptLevel = Level;
188  Config.PTO.LoopVectorization = Config.OptLevel > 1;
189  Config.PTO.SLPVectorization = Config.OptLevel > 1;
190  switch (Config.OptLevel) {
191  case 0:
192  Config.CGOptLevel = CodeGenOpt::None;
193  return;
194  case 1:
195  Config.CGOptLevel = CodeGenOpt::Less;
196  return;
197  case 2:
199  return;
200  case 3:
202  return;
203  }
204  llvm_unreachable("Unknown optimization level!");
205 }
206 
208  if (!determineTarget())
209  return false;
210 
211  // We always run the verifier once on the merged module.
212  verifyMergedModuleOnce();
213 
214  // mark which symbols can not be internalized
215  applyScopeRestrictions();
216 
217  // create output file
218  std::error_code EC;
219  ToolOutputFile Out(Path, EC, sys::fs::OF_None);
220  if (EC) {
221  std::string ErrMsg = "could not open bitcode file for writing: ";
222  ErrMsg += Path.str() + ": " + EC.message();
223  emitError(ErrMsg);
224  return false;
225  }
226 
227  // write bitcode to it
228  WriteBitcodeToFile(*MergedModule, Out.os(), ShouldEmbedUselists);
229  Out.os().close();
230 
231  if (Out.os().has_error()) {
232  std::string ErrMsg = "could not write bitcode file: ";
233  ErrMsg += Path.str() + ": " + Out.os().error().message();
234  emitError(ErrMsg);
235  Out.os().clear_error();
236  return false;
237  }
238 
239  Out.keep();
240  return true;
241 }
242 
243 bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
244  // make unique temp output file to put generated code
245  SmallString<128> Filename;
246 
247  auto AddStream = [&](size_t Task) -> std::unique_ptr<CachedFileStream> {
248  StringRef Extension(Config.CGFileType == CGFT_AssemblyFile ? "s" : "o");
249 
250  int FD;
251  std::error_code EC =
252  sys::fs::createTemporaryFile("lto-llvm", Extension, FD, Filename);
253  if (EC)
254  emitError(EC.message());
255 
256  return std::make_unique<CachedFileStream>(
257  std::make_unique<llvm::raw_fd_ostream>(FD, true));
258  };
259 
260  bool genResult = compileOptimized(AddStream, 1);
261 
262  if (!genResult) {
263  sys::fs::remove(Twine(Filename));
264  return false;
265  }
266 
267  // If statistics were requested, save them to the specified file or
268  // print them out after codegen.
269  if (StatsFile)
270  PrintStatisticsJSON(StatsFile->os());
271  else if (AreStatisticsEnabled())
272  PrintStatistics();
273 
274  NativeObjectPath = Filename.c_str();
275  *Name = NativeObjectPath.c_str();
276  return true;
277 }
278 
279 std::unique_ptr<MemoryBuffer>
281  const char *name;
282  if (!compileOptimizedToFile(&name))
283  return nullptr;
284 
285  // read .o file into memory buffer
287  name, /*IsText=*/false, /*RequiresNullTerminator=*/false);
288  if (std::error_code EC = BufferOrErr.getError()) {
289  emitError(EC.message());
290  sys::fs::remove(NativeObjectPath);
291  return nullptr;
292  }
293 
294  // remove temp files
295  sys::fs::remove(NativeObjectPath);
296 
297  return std::move(*BufferOrErr);
298 }
299 
301  if (!optimize())
302  return false;
303 
304  return compileOptimizedToFile(Name);
305 }
306 
307 std::unique_ptr<MemoryBuffer> LTOCodeGenerator::compile() {
308  if (!optimize())
309  return nullptr;
310 
311  return compileOptimized();
312 }
313 
314 bool LTOCodeGenerator::determineTarget() {
315  if (TargetMach)
316  return true;
317 
318  TripleStr = MergedModule->getTargetTriple();
319  if (TripleStr.empty()) {
320  TripleStr = sys::getDefaultTargetTriple();
321  MergedModule->setTargetTriple(TripleStr);
322  }
323  llvm::Triple Triple(TripleStr);
324 
325  // create target machine from info for merged modules
326  std::string ErrMsg;
327  MArch = TargetRegistry::lookupTarget(TripleStr, ErrMsg);
328  if (!MArch) {
329  emitError(ErrMsg);
330  return false;
331  }
332 
333  // Construct LTOModule, hand over ownership of module and target. Use MAttr as
334  // the default set of features.
335  SubtargetFeatures Features(join(Config.MAttrs, ""));
336  Features.getDefaultSubtargetFeatures(Triple);
337  FeatureStr = Features.getString();
338  // Set a default CPU for Darwin triples.
339  if (Config.CPU.empty() && Triple.isOSDarwin()) {
341  Config.CPU = "core2";
342  else if (Triple.getArch() == llvm::Triple::x86)
343  Config.CPU = "yonah";
344  else if (Triple.isArm64e())
345  Config.CPU = "apple-a12";
346  else if (Triple.getArch() == llvm::Triple::aarch64 ||
348  Config.CPU = "cyclone";
349  }
350 
351  TargetMach = createTargetMachine();
352  assert(TargetMach && "Unable to create target machine");
353 
354  return true;
355 }
356 
357 std::unique_ptr<TargetMachine> LTOCodeGenerator::createTargetMachine() {
358  assert(MArch && "MArch is not set!");
359  return std::unique_ptr<TargetMachine>(MArch->createTargetMachine(
360  TripleStr, Config.CPU, FeatureStr, Config.Options, Config.RelocModel,
361  None, Config.CGOptLevel));
362 }
363 
364 // If a linkonce global is present in the MustPreserveSymbols, we need to make
365 // sure we honor this. To force the compiler to not drop it, we add it to the
366 // "llvm.compiler.used" global.
367 void LTOCodeGenerator::preserveDiscardableGVs(
368  Module &TheModule,
370  std::vector<GlobalValue *> Used;
371  auto mayPreserveGlobal = [&](GlobalValue &GV) {
372  if (!GV.isDiscardableIfUnused() || GV.isDeclaration() ||
373  !mustPreserveGV(GV))
374  return;
375  if (GV.hasAvailableExternallyLinkage())
376  return emitWarning(
377  (Twine("Linker asked to preserve available_externally global: '") +
378  GV.getName() + "'").str());
379  if (GV.hasInternalLinkage())
380  return emitWarning((Twine("Linker asked to preserve internal global: '") +
381  GV.getName() + "'").str());
382  Used.push_back(&GV);
383  };
384  for (auto &GV : TheModule)
385  mayPreserveGlobal(GV);
386  for (auto &GV : TheModule.globals())
387  mayPreserveGlobal(GV);
388  for (auto &GV : TheModule.aliases())
389  mayPreserveGlobal(GV);
390 
391  if (Used.empty())
392  return;
393 
394  appendToCompilerUsed(TheModule, Used);
395 }
396 
397 void LTOCodeGenerator::applyScopeRestrictions() {
398  if (ScopeRestrictionsDone)
399  return;
400 
401  // Declare a callback for the internalize pass that will ask for every
402  // candidate GlobalValue if it can be internalized or not.
403  Mangler Mang;
404  SmallString<64> MangledName;
405  auto mustPreserveGV = [&](const GlobalValue &GV) -> bool {
406  // Unnamed globals can't be mangled, but they can't be preserved either.
407  if (!GV.hasName())
408  return false;
409 
410  // Need to mangle the GV as the "MustPreserveSymbols" StringSet is filled
411  // with the linker supplied name, which on Darwin includes a leading
412  // underscore.
413  MangledName.clear();
414  MangledName.reserve(GV.getName().size() + 1);
415  Mang.getNameWithPrefix(MangledName, &GV, /*CannotUsePrivateLabel=*/false);
416  return MustPreserveSymbols.count(MangledName);
417  };
418 
419  // Preserve linkonce value on linker request
420  preserveDiscardableGVs(*MergedModule, mustPreserveGV);
421 
422  if (!ShouldInternalize)
423  return;
424 
425  if (ShouldRestoreGlobalsLinkage) {
426  // Record the linkage type of non-local symbols so they can be restored
427  // prior
428  // to module splitting.
429  auto RecordLinkage = [&](const GlobalValue &GV) {
430  if (!GV.hasAvailableExternallyLinkage() && !GV.hasLocalLinkage() &&
431  GV.hasName())
432  ExternalSymbols.insert(std::make_pair(GV.getName(), GV.getLinkage()));
433  };
434  for (auto &GV : *MergedModule)
435  RecordLinkage(GV);
436  for (auto &GV : MergedModule->globals())
437  RecordLinkage(GV);
438  for (auto &GV : MergedModule->aliases())
439  RecordLinkage(GV);
440  }
441 
442  // Update the llvm.compiler_used globals to force preserving libcalls and
443  // symbols referenced from asm
444  updateCompilerUsed(*MergedModule, *TargetMach, AsmUndefinedRefs);
445 
446  internalizeModule(*MergedModule, mustPreserveGV);
447 
448  ScopeRestrictionsDone = true;
449 }
450 
451 /// Restore original linkage for symbols that may have been internalized
452 void LTOCodeGenerator::restoreLinkageForExternals() {
453  if (!ShouldInternalize || !ShouldRestoreGlobalsLinkage)
454  return;
455 
456  assert(ScopeRestrictionsDone &&
457  "Cannot externalize without internalization!");
458 
459  if (ExternalSymbols.empty())
460  return;
461 
462  auto externalize = [this](GlobalValue &GV) {
463  if (!GV.hasLocalLinkage() || !GV.hasName())
464  return;
465 
466  auto I = ExternalSymbols.find(GV.getName());
467  if (I == ExternalSymbols.end())
468  return;
469 
470  GV.setLinkage(I->second);
471  };
472 
473  llvm::for_each(MergedModule->functions(), externalize);
474  llvm::for_each(MergedModule->globals(), externalize);
475  llvm::for_each(MergedModule->aliases(), externalize);
476 }
477 
478 void LTOCodeGenerator::verifyMergedModuleOnce() {
479  // Only run on the first call.
480  if (HasVerifiedInput)
481  return;
482  HasVerifiedInput = true;
483 
484  bool BrokenDebugInfo = false;
485  if (verifyModule(*MergedModule, &dbgs(), &BrokenDebugInfo))
486  report_fatal_error("Broken module found, compilation aborted!");
487  if (BrokenDebugInfo) {
488  emitWarning("Invalid debug info found, debug info will be stripped");
489  StripDebugInfo(*MergedModule);
490  }
491 }
492 
493 void LTOCodeGenerator::finishOptimizationRemarks() {
494  if (DiagnosticOutputFile) {
495  DiagnosticOutputFile->keep();
496  // FIXME: LTOCodeGenerator dtor is not invoked on Darwin
497  DiagnosticOutputFile->os().flush();
498  }
499 }
500 
501 /// Optimize merged modules using various IPO passes
503  if (!this->determineTarget())
504  return false;
505 
506  auto DiagFileOrErr = lto::setupLLVMOptimizationRemarks(
509  if (!DiagFileOrErr) {
510  errs() << "Error: " << toString(DiagFileOrErr.takeError()) << "\n";
511  report_fatal_error("Can't get an output file for the remarks");
512  }
513  DiagnosticOutputFile = std::move(*DiagFileOrErr);
514 
515  // Setup output file to emit statistics.
516  auto StatsFileOrErr = lto::setupStatsFile(LTOStatsFile);
517  if (!StatsFileOrErr) {
518  errs() << "Error: " << toString(StatsFileOrErr.takeError()) << "\n";
519  report_fatal_error("Can't get an output file for the statistics");
520  }
521  StatsFile = std::move(StatsFileOrErr.get());
522 
523  // Currently there is no support for enabling whole program visibility via a
524  // linker option in the old LTO API, but this call allows it to be specified
525  // via the internal option. Must be done before WPD invoked via the optimizer
526  // pipeline run below.
527  updateVCallVisibilityInModule(*MergedModule,
528  /* WholeProgramVisibilityEnabledInLTO */ false,
529  // FIXME: This needs linker information via a
530  // TBD new interface.
531  /* DynamicExportSymbols */ {});
532 
533  // We always run the verifier once on the merged module, the `DisableVerify`
534  // parameter only applies to subsequent verify.
535  verifyMergedModuleOnce();
536 
537  // Mark which symbols can not be internalized
538  this->applyScopeRestrictions();
539 
540  // Write LTOPostLink flag for passes that require all the modules.
541  MergedModule->addModuleFlag(Module::Error, "LTOPostLink", 1);
542 
543  // Add an appropriate DataLayout instance for this module...
544  MergedModule->setDataLayout(TargetMach->createDataLayout());
545 
546  ModuleSummaryIndex CombinedIndex(false);
547  TargetMach = createTargetMachine();
548  if (!opt(Config, TargetMach.get(), 0, *MergedModule, /*IsThinLTO=*/false,
549  /*ExportSummary=*/&CombinedIndex, /*ImportSummary=*/nullptr,
550  /*CmdArgs*/ std::vector<uint8_t>())) {
551  emitError("LTO middle-end optimizations failed");
552  return false;
553  }
554 
555  return true;
556 }
557 
559  unsigned ParallelismLevel) {
560  if (!this->determineTarget())
561  return false;
562 
563  // We always run the verifier once on the merged module. If it has already
564  // been called in optimize(), this call will return early.
565  verifyMergedModuleOnce();
566 
567  // Re-externalize globals that may have been internalized to increase scope
568  // for splitting
569  restoreLinkageForExternals();
570 
571  ModuleSummaryIndex CombinedIndex(false);
572 
573  Config.CodeGenOnly = true;
574  Error Err = backend(Config, AddStream, ParallelismLevel, *MergedModule,
575  CombinedIndex);
576  assert(!Err && "unexpected code-generation failure");
577  (void)Err;
578 
579  // If statistics were requested, save them to the specified file or
580  // print them out after codegen.
581  if (StatsFile)
582  PrintStatisticsJSON(StatsFile->os());
583  else if (AreStatisticsEnabled())
584  PrintStatistics();
585 
587 
588  finishOptimizationRemarks();
589 
590  return true;
591 }
592 
594  for (StringRef Option : Options)
595  CodegenOptions.push_back(Option.str());
596 }
597 
599  if (!CodegenOptions.empty())
600  llvm::parseCommandLineOptions(CodegenOptions);
601 }
602 
603 void llvm::parseCommandLineOptions(std::vector<std::string> &Options) {
604  if (!Options.empty()) {
605  // ParseCommandLineOptions() expects argv[0] to be program name.
606  std::vector<const char *> CodegenArgv(1, "libLLVMLTO");
607  for (std::string &Arg : Options)
608  CodegenArgv.push_back(Arg.c_str());
609  cl::ParseCommandLineOptions(CodegenArgv.size(), CodegenArgv.data());
610  }
611 }
612 
614  // Map the LLVM internal diagnostic severity to the LTO diagnostic severity.
616  switch (DI.getSeverity()) {
617  case DS_Error:
618  Severity = LTO_DS_ERROR;
619  break;
620  case DS_Warning:
621  Severity = LTO_DS_WARNING;
622  break;
623  case DS_Remark:
624  Severity = LTO_DS_REMARK;
625  break;
626  case DS_Note:
627  Severity = LTO_DS_NOTE;
628  break;
629  }
630  // Create the string that will be reported to the external diagnostic handler.
631  std::string MsgStorage;
632  raw_string_ostream Stream(MsgStorage);
634  DI.print(DP);
635  Stream.flush();
636 
637  // If this method has been called it means someone has set up an external
638  // diagnostic handler. Assert on that.
639  assert(DiagHandler && "Invalid diagnostic handler");
640  (*DiagHandler)(Severity, MsgStorage.c_str(), DiagContext);
641 }
642 
643 namespace {
644 struct LTODiagnosticHandler : public DiagnosticHandler {
645  LTOCodeGenerator *CodeGenerator;
646  LTODiagnosticHandler(LTOCodeGenerator *CodeGenPtr)
647  : CodeGenerator(CodeGenPtr) {}
648  bool handleDiagnostics(const DiagnosticInfo &DI) override {
649  CodeGenerator->DiagnosticHandler(DI);
650  return true;
651  }
652 };
653 }
654 
655 void
657  void *Ctxt) {
658  this->DiagHandler = DiagHandler;
659  this->DiagContext = Ctxt;
660  if (!DiagHandler)
661  return Context.setDiagnosticHandler(nullptr);
662  // Register the LTOCodeGenerator stub in the LLVMContext to forward the
663  // diagnostic to the external DiagHandler.
664  Context.setDiagnosticHandler(std::make_unique<LTODiagnosticHandler>(this),
665  true);
666 }
667 
668 namespace {
669 class LTODiagnosticInfo : public DiagnosticInfo {
670  const Twine &Msg;
671 public:
672  LTODiagnosticInfo(const Twine &DiagMsg, DiagnosticSeverity Severity=DS_Error)
673  : DiagnosticInfo(DK_Linker, Severity), Msg(DiagMsg) {}
674  void print(DiagnosticPrinter &DP) const override { DP << Msg; }
675 };
676 }
677 
678 void LTOCodeGenerator::emitError(const std::string &ErrMsg) {
679  if (DiagHandler)
680  (*DiagHandler)(LTO_DS_ERROR, ErrMsg.c_str(), DiagContext);
681  else
682  Context.diagnose(LTODiagnosticInfo(ErrMsg));
683 }
684 
685 void LTOCodeGenerator::emitWarning(const std::string &ErrMsg) {
686  if (DiagHandler)
687  (*DiagHandler)(LTO_DS_WARNING, ErrMsg.c_str(), DiagContext);
688  else
689  Context.diagnose(LTODiagnosticInfo(ErrMsg, DS_Warning));
690 }
llvm::RemarksPasses
cl::opt< std::string > RemarksPasses("lto-pass-remarks-filter", cl::desc("Only record optimization remarks from passes whose " "names match the given regular expression"), cl::value_desc("regex"))
Definition: ThinLTOCodeGenerator.cpp:82
MemoryBuffer.h
lto_codegen_diagnostic_severity_t
lto_codegen_diagnostic_severity_t
Diagnostic severity.
Definition: lto.h:330
llvm::LTOCodeGenerator::setCodeGenDebugOptions
void setCodeGenDebugOptions(ArrayRef< StringRef > Opts)
Pass options to the driver and optimization passes.
Definition: LTOCodeGenerator.cpp:593
Signals.h
llvm::StripDebugInfo
bool StripDebugInfo(Module &M)
Strip debug info in the module if it exists.
Definition: DebugInfo.cpp:475
llvm::LTOCodeGenerator::setDiagnosticHandler
void setDiagnosticHandler(lto_diagnostic_handler_t, void *)
Definition: LTOCodeGenerator.cpp:656
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::reportAndResetTimings
void reportAndResetTimings(raw_ostream *OutStream=nullptr)
If -time-passes has been specified, report the timings immediately and then reset the timers to zero.
Definition: PassTimingInfo.cpp:162
llvm::raw_fd_ostream::close
void close()
Manually flush the stream and close the file.
Definition: raw_ostream.cpp:793
mustPreserveGV
static bool mustPreserveGV(const GlobalValue &GV)
Predicate for Internalize pass.
Definition: AMDGPUTargetMachine.cpp:518
FileSystem.h
llvm::sys::fs::OF_None
@ OF_None
Definition: FileSystem.h:757
llvm::ToolOutputFile
This class contains a raw_fd_ostream and adds a few extra features commonly needed for compiler-like ...
Definition: ToolOutputFile.h:26
LTO_DEBUG_MODEL_NONE
@ LTO_DEBUG_MODEL_NONE
Definition: lto.h:80
print
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Definition: ArchiveWriter.cpp:148
llvm::LTOCodeGenerator::parseCodeGenDebugOptions
void parseCodeGenDebugOptions()
Parse the options set in setCodeGenDebugOptions.
Definition: LTOCodeGenerator.cpp:598
llvm::TargetOptions
Definition: TargetOptions.h:124
LTO_DS_NOTE
@ LTO_DS_NOTE
Definition: lto.h:334
LTO_DS_REMARK
@ LTO_DS_REMARK
Definition: lto.h:333
llvm::lto::Config::CGOptLevel
CodeGenOpt::Level CGOptLevel
Definition: Config.h:55
llvm::LTOStatsFile
cl::opt< std::string > LTOStatsFile("lto-stats-file", cl::desc("Save statistics to the specified file"), cl::Hidden)
llvm::DiagnosticPrinterRawOStream
Basic diagnostic printer that uses an underlying raw_ostream.
Definition: DiagnosticPrinter.h:61
llvm::lto::Config::CodeModel
Optional< CodeModel::Model > CodeModel
Definition: Config.h:54
llvm::Triple::x86
@ x86
Definition: Triple.h:82
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:632
llvm::toString
std::string toString(Error E)
Write all error messages (if any) in E to a string.
Definition: Error.h:1028
Host.h
Statistic.h
llvm::AddStreamFn
std::function< Expected< std::unique_ptr< CachedFileStream > >(unsigned Task)> AddStreamFn
This type defines the callback to add a file that is generated on the fly.
Definition: Caching.h:42
llvm::RemarksFilename
cl::opt< std::string > RemarksFilename("lto-pass-remarks-output", cl::desc("Output filename for pass remarks"), cl::value_desc("filename"))
Definition: ThinLTOCodeGenerator.cpp:81
llvm::LTOCodeGenerator::LTOCodeGenerator
LTOCodeGenerator(LLVMContext &Context)
Definition: LTOCodeGenerator.cpp:122
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::LTOCodeGenerator::setDebugInfo
void setDebugInfo(lto_debug_model)
Definition: LTOCodeGenerator.cpp:173
llvm::DiagnosticInfo::print
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:143
llvm::LTOCodeGenerator::setTargetOptions
void setTargetOptions(const TargetOptions &Options)
Definition: LTOCodeGenerator.cpp:169
externalize
static void externalize(GlobalValue *GV)
Definition: SplitModule.cpp:218
llvm::DK_Linker
@ DK_Linker
Definition: DiagnosticInfo.h:60
llvm::StringMap::end
iterator end()
Definition: StringMap.h:204
ParallelCG.h
Module.h
llvm::Triple::x86_64
@ x86_64
Definition: Triple.h:83
llvm::RemarksHotnessThreshold
cl::opt< Optional< uint64_t >, false, remarks::HotnessThresholdParser > RemarksHotnessThreshold("lto-pass-remarks-hotness-threshold", cl::desc("Minimum profile count required for an " "optimization remark to be output." " Use 'auto' to apply the threshold from profile summary."), cl::value_desc("uint or 'auto'"), cl::init(0), cl::Hidden)
Definition: ThinLTOCodeGenerator.cpp:85
llvm::DiagnosticHandler
This is the base class for diagnostic handling in LLVM.
Definition: DiagnosticHandler.h:24
llvm::ToolOutputFile::keep
void keep()
Indicate that the tool's job wrt this output file has been successful and the file should not be dele...
Definition: ToolOutputFile.h:67
UpdateCompilerUsed.h
ret
to esp esp setne al movzbw ax esp setg cl movzbw cx cmove cx cl jne LBB1_2 esp ret(also really horrible code on ppc). This is due to the expand code for 64-bit compares. GCC produces multiple branches
llvm::LTOCodeGenerator::compile_to_file
bool compile_to_file(const char **Name)
Compile the merged module into a single output file; the path to output file is returned to the calle...
Definition: LTOCodeGenerator.cpp:300
llvm::RemarksWithHotness
cl::opt< bool > RemarksWithHotness("lto-pass-remarks-with-hotness", cl::desc("With PGO, include profile count in optimization remarks"), cl::Hidden)
Definition: ThinLTOCodeGenerator.cpp:83
llvm::RegState::Undef
@ Undef
Value of the register doesn't matter.
Definition: MachineInstrBuilder.h:52
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:893
llvm::StringSet::insert
std::pair< typename Base::iterator, bool > insert(StringRef key)
Definition: StringSet.h:33
llvm::lto::setupLLVMOptimizationRemarks
Expected< std::unique_ptr< ToolOutputFile > > setupLLVMOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, Optional< uint64_t > RemarksHotnessThreshold=0, int Count=-1)
Setup optimization remarks.
Definition: LTO.cpp:1578
llvm::StringMap::find
iterator find(StringRef Key)
Definition: StringMap.h:217
llvm::Mangler
Definition: Mangler.h:27
llvm::Triple::aarch64_32
@ aarch64_32
Definition: Triple.h:53
llvm::lto::Config::CodeGenOnly
bool CodeGenOnly
Disable entirely the optimizer, including importing for ThinLTO.
Definition: Config.h:68
llvm::LTOCodeGenerator::setOptLevel
void setOptLevel(unsigned OptLevel)
Definition: LTOCodeGenerator.cpp:186
llvm::TargetRegistry::lookupTarget
static const Target * lookupTarget(const std::string &Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
Definition: TargetRegistry.cpp:62
LTO_DS_WARNING
@ LTO_DS_WARNING
Definition: lto.h:332
LegacyPassManager.h
PassManagerBuilder.h
Internalize.h
endif
__FakeVCSRevision h endif() endif() set(generated_files "$
Definition: CMakeLists.txt:16
llvm::lto::setupStatsFile
Expected< std::unique_ptr< ToolOutputFile > > setupStatsFile(StringRef StatsFilename)
Setups the output file for saving statistics.
Definition: LTO.cpp:1603
new
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM ID Predecessors according to mbb< bb27, 0x8b0a7c0 > Note ADDri is not a two address instruction its result reg1037 is an operand of the PHI node in bb76 and its operand reg1039 is the result of the PHI node We should treat it as a two address code and make sure the ADDri is scheduled after any node that reads reg1039 Use info(i.e. register scavenger) to assign it a free register to allow reuse the collector could move the objects and invalidate the derived pointer This is bad enough in the first but safe points can crop up unpredictably **array_addr i32 n y store obj * new
Definition: README.txt:125
Context
ManagedStatic< detail::RecordContext > Context
Definition: Record.cpp:96
llvm::LTOCodeGenerator::addModule
bool addModule(struct LTOModule *)
Merge given module.
Definition: LTOCodeGenerator.cpp:142
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:185
PassTimingInfo.h
CommandLine.h
llvm::MemoryBuffer::getFile
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
Definition: MemoryBuffer.cpp:236
llvm::AreStatisticsEnabled
bool AreStatisticsEnabled()
Check if statistics are enabled.
Definition: Statistic.cpp:138
llvm::LTOCodeGenerator::compile
std::unique_ptr< MemoryBuffer > compile()
As with compile_to_file(), this function compiles the merged module into single output file.
Definition: LTOCodeGenerator.cpp:307
SubtargetFeature.h
Constants.h
llvm::raw_fd_ostream::has_error
bool has_error() const
Return the value of the flag in this raw_fd_ostream indicating whether an output error has been encou...
Definition: raw_ostream.h:535
llvm::Triple::isOSDarwin
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
Definition: Triple.h:468
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:47
Linker.h
BitcodeWriter.h
llvm::raw_fd_ostream::clear_error
void clear_error()
Set the flag read by has_error() to false.
Definition: raw_ostream.h:546
llvm::LTODiscardValueNames
cl::opt< bool > LTODiscardValueNames("lto-discard-value-names", cl::desc("Strip names from Value during LTO (other than GlobalValue)."), cl::init(false), cl::Hidden)
Definition: ThinLTOCodeGenerator.cpp:80
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:275
MCContext.h
llvm::lto::Config::Options
TargetOptions Options
Definition: Config.h:48
llvm::lto::Config::PreCodeGenPassesHook
std::function< void(legacy::PassManager &)> PreCodeGenPassesHook
For adding passes that run right before codegen.
Definition: Config.h:52
llvm::cl::ParseCommandLineOptions
bool ParseCommandLineOptions(int argc, const char *const *argv, StringRef Overview="", raw_ostream *Errs=nullptr, const char *EnvVar=nullptr, bool LongOptionsUseDoubleDash=false)
Definition: CommandLine.cpp:1339
llvm::SubtargetFeatures
Manages the enabling and disabling of subtarget specific features.
Definition: SubtargetFeature.h:184
HotnessThresholdParser.h
TargetLibraryInfo.h
llvm::ErrorOr::getError
std::error_code getError() const
Definition: ErrorOr.h:153
llvm::Mangler::getNameWithPrefix
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
Definition: Mangler.cpp:119
llvm::LTOCodeGenerator::compileOptimized
std::unique_ptr< MemoryBuffer > compileOptimized()
Compiles the merged optimized module into a single output file.
Definition: LTOCodeGenerator.cpp:280
opt
arm prera ldst opt
Definition: ARMLoadStoreOptimizer.cpp:2189
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition: DiagnosticInfo.h:45
LTOModule.h
llvm::StringMap::clear
void clear()
Definition: StringMap.h:347
llvm::appendToCompilerUsed
void appendToCompilerUsed(Module &M, ArrayRef< GlobalValue * > Values)
Adds global values to the llvm.compiler.used list.
Definition: ModuleUtils.cpp:110
llvm::report_fatal_error
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:143
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::raw_ostream::flush
void flush()
Definition: raw_ostream.h:187
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:118
llvm::LTOCodeGenerator::optimize
bool optimize()
Optimizes the merged module.
Definition: LTOCodeGenerator.cpp:502
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:103
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
llvm::LLVMContext::setDiagnosticHandler
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
Definition: LLVMContext.cpp:122
llvm::Triple::getArch
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition: Triple.h:311
llvm::StringRef::str
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:245
llvm::None
const NoneType None
Definition: None.h:23
llvm::lto::Config::StatsFile
std::string StatsFile
Statistics output file path.
Definition: Config.h:163
lto_debug_model
lto_debug_model
Definition: lto.h:79
llvm::SmallString< 128 >
llvm::RemarksFormat
cl::opt< std::string > RemarksFormat("lto-pass-remarks-format", cl::desc("The format used for serializing remarks (default: YAML)"), cl::value_desc("format"), cl::init("yaml"))
Definition: ThinLTOCodeGenerator.cpp:86
LTOBackend.h
llvm::lto::Config::OptLevel
unsigned OptLevel
Definition: Config.h:57
llvm::LTOCodeGenerator::DiagnosticHandler
void DiagnosticHandler(const DiagnosticInfo &DI)
Definition: LTOCodeGenerator.cpp:613
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::LTOCodeGenerator::getVersionString
static const char * getVersionString()
Definition: LTOCodeGenerator.cpp:68
llvm::cl::opt< bool >
llvm::SmallString::c_str
const char * c_str()
Definition: SmallString.h:262
llvm::PrintStatisticsJSON
void PrintStatisticsJSON(raw_ostream &OS)
Print statistics in JSON format.
Definition: Statistic.cpp:202
llvm::lto::backend
Error backend(const Config &C, AddStreamFn AddStream, unsigned ParallelCodeGenParallelismLevel, Module &M, ModuleSummaryIndex &CombinedIndex)
Runs a regular LTO backend.
Definition: LTOBackend.cpp:509
llvm::parseCommandLineOptions
void parseCommandLineOptions(std::vector< std::string > &Options)
A convenience function that calls cl::ParseCommandLineOptions on the given set of options.
Definition: LTOCodeGenerator.cpp:603
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::CodeGenOpt::Default
@ Default
Definition: CodeGen.h:55
llvm::LTOCodeGenerator::~LTOCodeGenerator
~LTOCodeGenerator()
Definition: LTOCodeGenerator.cpp:135
llvm::for_each
UnaryFunction for_each(R &&Range, UnaryFunction F)
Provide wrappers to std::for_each which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1585
llvm::DS_Remark
@ DS_Remark
Definition: DiagnosticInfo.h:48
llvm::remarks::HotnessThresholdParser
Definition: HotnessThresholdParser.h:45
IPO.h
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
DebugInfo.h
llvm::LTOCodeGenerator
C++ class which implements the opaque lto_code_gen_t type.
Definition: LTOCodeGenerator.h:72
I
#define I(x, y, z)
Definition: MD5.cpp:58
Debug
bool Debug
Definition: PassBuilderBindings.cpp:51
StringExtras.h
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:441
ToolOutputFile.h
LTO_DS_ERROR
@ LTO_DS_ERROR
Definition: lto.h:331
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::PipelineTuningOptions::SLPVectorization
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization, set based on opt level.
Definition: PassBuilder.h:53
lto_diagnostic_handler_t
void(* lto_diagnostic_handler_t)(lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt)
Diagnostic handler type.
Definition: lto.h:346
PreferPredicateTy::Option
Option
Definition: LoopVectorize.cpp:212
llvm::lto::Config::MAttrs
std::vector< std::string > MAttrs
Definition: Config.h:49
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
NDEBUG
#define NDEBUG
Definition: regutils.h:48
llvm::updateCompilerUsed
void updateCompilerUsed(Module &TheModule, const TargetMachine &TM, const StringSet<> &AsmUndefinedRefs)
Find all globals in TheModule that are referenced in AsmUndefinedRefs, as well as the user-supplied f...
Definition: UpdateCompilerUsed.cpp:123
llvm::CodeGenOpt::Aggressive
@ Aggressive
Definition: CodeGen.h:56
llvm::PrintStatistics
void PrintStatistics()
Print statistics to the file returned by CreateInfoOutputFile().
Definition: Statistic.cpp:228
llvm::Linker
This class provides the core functionality of linking in LLVM.
Definition: Linker.h:22
llvm::internalizeModule
bool internalizeModule(Module &TheModule, std::function< bool(const GlobalValue &)> MustPreserveGV, CallGraph *CG=nullptr)
Helper function to internalize functions and variables in a Module.
Definition: Internalize.h:80
Mangler.h
YAMLTraits.h
llvm::CodeGenOpt::None
@ None
Definition: CodeGen.h:53
llvm::WriteBitcodeToFile
void WriteBitcodeToFile(const Module &M, raw_ostream &Out, bool ShouldPreserveUseListOrder=false, const ModuleSummaryIndex *Index=nullptr, bool GenerateHash=false, ModuleHash *ModHash=nullptr)
Write the specified module to the specified raw output stream.
Definition: BitcodeWriter.cpp:4626
llvm::sys::fs::remove
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
TargetOptions.h
llvm::raw_fd_ostream::error
std::error_code error() const
Definition: raw_ostream.h:529
llvm::sys::fs::createTemporaryFile
std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix, int &ResultFD, SmallVectorImpl< char > &ResultPath, OpenFlags Flags=OF_None)
Create a file in the system temporary directory.
Definition: Path.cpp:860
llvm::sys::getDefaultTargetTriple
std::string getDefaultTargetTriple()
getDefaultTargetTriple() - Return the default target triple the compiler has been configured to produ...
llvm::LTOCodeGenerator::setModule
void setModule(std::unique_ptr< LTOModule > M)
Set the destination module.
Definition: LTOCodeGenerator.cpp:155
Extension
Definition: AArch64AsmParser.cpp:3250
llvm::lto::Config::RelocModel
Optional< Reloc::Model > RelocModel
Definition: Config.h:53
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::updateVCallVisibilityInModule
void updateVCallVisibilityInModule(Module &M, bool WholeProgramVisibilityEnabledInLTO, const DenseSet< GlobalValue::GUID > &DynamicExportSymbols)
If whole program visibility asserted, then upgrade all public vcall visibility metadata on vtable def...
Definition: WholeProgramDevirt.cpp:843
DiagHandler
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
Definition: TextStub.cpp:1094
MCAsmInfo.h
DataLayout.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
TargetSubtargetInfo.h
llvm::PipelineTuningOptions::LoopVectorization
bool LoopVectorization
Tuning option to enable/disable loop vectorization, set based on opt level.
Definition: PassBuilder.h:49
llvm::PICLevel::Level
Level
Definition: CodeGen.h:33
llvm::Module::Error
@ Error
Emits an error if two values disagree, otherwise the resulting value is that of the operands.
Definition: Module.h:118
llvm::LTOCodeGenerator::writeMergedModules
bool writeMergedModules(StringRef Path)
Write the merged module to the file specified by the given path.
Definition: LTOCodeGenerator.cpp:207
name
static const char * name
Definition: SVEIntrinsicOpts.cpp:74
llvm::LLVMContext::diagnose
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Definition: LLVMContext.cpp:228
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
Verifier.h
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
LLVMRemarkStreamer.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::legacy::PassManager
PassManager manages ModulePassManagers.
Definition: LegacyPassManager.h:52
llvm::ToolOutputFile::os
raw_fd_ostream & os()
Return the contained raw_fd_ostream.
Definition: ToolOutputFile.h:60
llvm::Module::getContext
LLVMContext & getContext() const
Get the global data context.
Definition: Module.h:259
DiagnosticInfo.h
llvm::Triple::isArm64e
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition: Triple.h:804
DP
So we should use XX3Form_Rcr to implement instrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store load store see def memrix16 in PPCInstrInfo td Load Store Vector load store outs ins lxsdx set load store with conversion from to DP
Definition: README_P9.txt:520
llvm::cl::value_desc
Definition: CommandLine.h:422
llvm::lto::Config::PTO
PipelineTuningOptions PTO
Tunable parameters for passes in the default pipelines.
Definition: Config.h:187
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:579
llvm::StringMap::count
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition: StringMap.h:245
LTO_DEBUG_MODEL_DWARF
@ LTO_DEBUG_MODEL_DWARF
Definition: lto.h:81
WholeProgramDevirt.h
llvm::lto::Config::CGFileType
CodeGenFileType CGFileType
Definition: Config.h:56
llvm::StringMapImpl::empty
bool empty() const
Definition: StringMap.h:93
ObjCARC.h
LTO.h
llvm::ModuleSummaryIndex
Class to hold module path string table and global value map, and encapsulate methods for operating on...
Definition: ModuleSummaryIndex.h:1088
ModuleUtils.h
llvm::ErrorOr
Represents either an error or a value T.
Definition: ErrorOr.h:56
TargetTransformInfo.h
DerivedTypes.h
TargetSelect.h
llvm::lto::Config::CPU
std::string CPU
Definition: Config.h:47
LLVMContext.h
llvm::LTOCodeGenerator::setAsmUndefinedRefs
void setAsmUndefinedRefs(struct LTOModule *)
Definition: LTOCodeGenerator.cpp:137
llvm::createObjCARCContractPass
Pass * createObjCARCContractPass()
Definition: ObjCARCContract.cpp:739
llvm::cl::desc
Definition: CommandLine.h:412
Mod
Module * Mod
Definition: PassBuilderBindings.cpp:54
llvm::CGFT_AssemblyFile
@ CGFT_AssemblyFile
Definition: CodeGen.h:64
raw_ostream.h
llvm::CodeGenOpt::Less
@ Less
Definition: CodeGen.h:54
llvm::SmallVectorImpl::reserve
void reserve(size_type N)
Definition: SmallVector.h:632
DiagnosticPrinter.h
TargetRegistry.h
InitializePasses.h
llvm::LTOModule
C++ class which implements the opaque lto_module_t type.
Definition: LTOModule.h:38
llvm::DS_Error
@ DS_Error
Definition: DiagnosticInfo.h:46
llvm::Triple::aarch64
@ aarch64
Definition: Triple.h:51
llvm::verifyModule
bool verifyModule(const Module &M, raw_ostream *OS=nullptr, bool *BrokenDebugInfo=nullptr)
Check a module for errors.
Definition: Verifier.cpp:5931
Passes.h
llvm::Target::createTargetMachine
TargetMachine * createTargetMachine(StringRef TT, StringRef CPU, StringRef Features, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM=None, CodeGenOpt::Level OL=CodeGenOpt::Default, bool JIT=false) const
createTargetMachine - Create a target specific machine implementation for the specified Triple.
Definition: TargetRegistry.h:449
llvm::DS_Note
@ DS_Note
Definition: DiagnosticInfo.h:51
LTOCodeGenerator.h