Go to the documentation of this file.
25 #include "llvm/Config/config.h"
66 #include <system_error>
70 return PACKAGE_NAME
" version " PACKAGE_VERSION;
75 "lto-discard-value-names",
76 cl::desc(
"Strip names from Value during LTO (other than GlobalValue)."),
85 "lto-pass-remarks-with-hotness",
86 cl::desc(
"With PGO, include profile count in optimization remarks"),
91 "lto-pass-remarks-hotness-threshold",
92 cl::desc(
"Minimum profile count required for an "
93 "optimization remark to be output."
94 " Use 'auto' to apply the threshold from profile summary."),
99 cl::desc(
"Output filename for pass remarks"),
104 cl::desc(
"Only record optimization remarks from passes whose "
105 "names match the given regular expression"),
109 "lto-pass-remarks-format",
110 cl::desc(
"The format used for serializing remarks (default: YAML)"),
115 cl::desc(
"Save statistics to the specified file"),
119 "lto-aix-system-assembler",
120 cl::desc(
"Path to a system assembler, picked up on AIX only"),
125 cl::desc(
"Perform context sensitive PGO instrumentation"));
129 cl::desc(
"Context sensitive profile file path"));
157 "Expected module in same context");
159 bool ret = TheLinker->linkInModule(
Mod->takeModule());
163 HasVerifiedInput =
false;
170 "Expected module in same context");
172 AsmUndefinedRefs.
clear();
174 MergedModule =
Mod->takeModule();
175 TheLinker = std::make_unique<Linker>(*MergedModule);
179 HasVerifiedInput =
false;
189 EmitDwarfDebugInfo =
false;
193 EmitDwarfDebugInfo =
true;
203 std::optional<CodeGenOpt::Level> CGOptLevelOrNone =
205 assert(CGOptLevelOrNone &&
"Unknown optimization level!");
210 if (!determineTarget())
214 verifyMergedModuleOnce();
217 applyScopeRestrictions();
223 std::string ErrMsg =
"could not open bitcode file for writing: ";
224 ErrMsg += Path.str() +
": " + EC.message();
234 std::string ErrMsg =
"could not write bitcode file: ";
235 ErrMsg += Path.str() +
": " + Out.
os().
error().message();
245 bool LTOCodeGenerator::useAIXSystemAssembler() {
246 const auto &
Triple = TargetMach->getTargetTriple();
250 bool LTOCodeGenerator::runAIXSystemAssembler(
SmallString<128> &AssemblyFile) {
251 assert(useAIXSystemAssembler() &&
252 "Runing AIX system assembler when integrated assembler is available!");
260 "Cannot find the assembler specified by lto-aix-system-assembler");
266 std::string LDR_CNTRL_var =
"LDR_CNTRL=MAXDATA32=0xA0000000@DSA";
268 LDR_CNTRL_var += (
"@" + *V);
271 const auto &
Triple = TargetMach->getTargetTriple();
273 std::string ObjectFileName(AssemblyFile);
274 ObjectFileName[ObjectFileName.size() - 1] =
'o';
276 "/bin/env", LDR_CNTRL_var,
279 ObjectFileName, AssemblyFile};
286 emitError(
"LTO assembler exited abnormally");
290 emitError(
"Unable to invoke LTO assembler");
294 emitError(
"LTO assembler invocation returned non-zero");
302 AssemblyFile = ObjectFileName;
307 bool LTOCodeGenerator::compileOptimizedToFile(
const char **Name) {
308 if (useAIXSystemAssembler())
323 emitError(
EC.message());
325 return std::make_unique<CachedFileStream>(
326 std::make_unique<llvm::raw_fd_ostream>(FD,
true));
343 if (useAIXSystemAssembler())
344 if (!runAIXSystemAssembler(Filename))
347 NativeObjectPath =
Filename.c_str();
348 *
Name = NativeObjectPath.c_str();
352 std::unique_ptr<MemoryBuffer>
355 if (!compileOptimizedToFile(&
name))
361 if (std::error_code EC = BufferOrErr.
getError()) {
362 emitError(EC.message());
377 return compileOptimizedToFile(Name);
387 bool LTOCodeGenerator::determineTarget() {
391 TripleStr = MergedModule->getTargetTriple();
392 if (TripleStr.empty()) {
394 MergedModule->setTargetTriple(TripleStr);
409 Features.getDefaultSubtargetFeatures(
Triple);
410 FeatureStr = Features.getString();
414 Config.
CPU =
"core2";
416 Config.
CPU =
"yonah";
418 Config.
CPU =
"apple-a12";
421 Config.
CPU =
"cyclone";
429 TargetMach = createTargetMachine();
430 assert(TargetMach &&
"Unable to create target machine");
435 std::unique_ptr<TargetMachine> LTOCodeGenerator::createTargetMachine() {
436 assert(MArch &&
"MArch is not set!");
445 void LTOCodeGenerator::preserveDiscardableGVs(
448 std::vector<GlobalValue *>
Used;
450 if (!GV.isDiscardableIfUnused() || GV.isDeclaration() ||
453 if (GV.hasAvailableExternallyLinkage())
455 (
Twine(
"Linker asked to preserve available_externally global: '") +
456 GV.getName() +
"'").str());
457 if (GV.hasInternalLinkage())
458 return emitWarning((
Twine(
"Linker asked to preserve internal global: '") +
459 GV.getName() +
"'").str());
462 for (
auto &GV : TheModule)
463 mayPreserveGlobal(GV);
464 for (
auto &GV : TheModule.globals())
465 mayPreserveGlobal(GV);
466 for (
auto &GV : TheModule.aliases())
467 mayPreserveGlobal(GV);
475 void LTOCodeGenerator::applyScopeRestrictions() {
476 if (ScopeRestrictionsDone)
492 MangledName.
reserve(GV.getName().size() + 1);
494 return MustPreserveSymbols.
count(MangledName);
500 if (!ShouldInternalize)
503 if (ShouldRestoreGlobalsLinkage) {
508 if (!GV.hasAvailableExternallyLinkage() && !GV.hasLocalLinkage() &&
510 ExternalSymbols.
insert(std::make_pair(GV.getName(), GV.getLinkage()));
512 for (
auto &GV : *MergedModule)
514 for (
auto &GV : MergedModule->globals())
516 for (
auto &GV : MergedModule->aliases())
526 ScopeRestrictionsDone =
true;
530 void LTOCodeGenerator::restoreLinkageForExternals() {
531 if (!ShouldInternalize || !ShouldRestoreGlobalsLinkage)
534 assert(ScopeRestrictionsDone &&
535 "Cannot externalize without internalization!");
537 if (ExternalSymbols.
empty())
541 if (!GV.hasLocalLinkage() || !GV.hasName())
544 auto I = ExternalSymbols.
find(GV.getName());
545 if (
I == ExternalSymbols.
end())
548 GV.setLinkage(
I->second);
556 void LTOCodeGenerator::verifyMergedModuleOnce() {
558 if (HasVerifiedInput)
560 HasVerifiedInput =
true;
562 bool BrokenDebugInfo =
false;
565 if (BrokenDebugInfo) {
566 emitWarning(
"Invalid debug info found, debug info will be stripped");
571 void LTOCodeGenerator::finishOptimizationRemarks() {
572 if (DiagnosticOutputFile) {
573 DiagnosticOutputFile->keep();
575 DiagnosticOutputFile->os().flush();
581 if (!this->determineTarget())
587 if (!DiagFileOrErr) {
588 errs() <<
"Error: " <<
toString(DiagFileOrErr.takeError()) <<
"\n";
591 DiagnosticOutputFile =
std::move(*DiagFileOrErr);
595 if (!StatsFileOrErr) {
596 errs() <<
"Error: " <<
toString(StatsFileOrErr.takeError()) <<
"\n";
599 StatsFile =
std::move(StatsFileOrErr.get());
615 verifyMergedModuleOnce();
618 this->applyScopeRestrictions();
621 MergedModule->addModuleFlag(
Module::Error,
"LTOPostLink", 1);
624 MergedModule->setDataLayout(TargetMach->createDataLayout());
626 if (!SaveIRBeforeOptPath.empty()) {
631 " to save optimized bitcode\n");
637 TargetMach = createTargetMachine();
638 if (!
opt(Config, TargetMach.get(), 0, *MergedModule,
false,
639 &CombinedIndex,
nullptr,
640 std::vector<uint8_t>())) {
641 emitError(
"LTO middle-end optimizations failed");
649 unsigned ParallelismLevel) {
650 if (!this->determineTarget())
655 verifyMergedModuleOnce();
659 restoreLinkageForExternals();
664 Error Err =
backend(Config, AddStream, ParallelismLevel, *MergedModule,
666 assert(!Err &&
"unexpected code-generation failure");
678 finishOptimizationRemarks();
685 CodegenOptions.push_back(
Option.str());
689 if (!CodegenOptions.empty())
696 std::vector<const char *> CodegenArgv(1,
"libLLVMLTO");
698 CodegenArgv.push_back(
Arg.c_str());
721 std::string MsgStorage;
729 assert(DiagHandler &&
"Invalid diagnostic handler");
730 (*DiagHandler)(Severity, MsgStorage.c_str(), DiagContext);
737 : CodeGenerator(CodeGenPtr) {}
748 this->DiagHandler = DiagHandler;
749 this->DiagContext = Ctxt;
768 void LTOCodeGenerator::emitError(
const std::string &ErrMsg) {
770 (*DiagHandler)(
LTO_DS_ERROR, ErrMsg.c_str(), DiagContext);
772 Context.
diagnose(LTODiagnosticInfo(ErrMsg));
775 void LTOCodeGenerator::emitWarning(
const std::string &ErrMsg) {
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"))
@ Undef
Value of the register doesn't matter.
void enableDebugTypeODRUniquing()
lto_codegen_diagnostic_severity_t
Diagnostic severity.
void setCodeGenDebugOptions(ArrayRef< StringRef > Opts)
Pass options to the driver and optimization passes.
bool StripDebugInfo(Module &M)
Strip debug info in the module if it exists.
void setDiagnosticHandler(lto_diagnostic_handler_t, void *)
This is an optimization pass for GlobalISel generic memory operations.
Expected< std::unique_ptr< ToolOutputFile > > setupLLVMOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional< uint64_t > RemarksHotnessThreshold=0, int Count=-1)
Setup optimization remarks.
void reportAndResetTimings(raw_ostream *OutStream=nullptr)
If -time-passes has been specified, report the timings immediately and then reset the timers to zero.
void close()
Manually flush the stream and close the file.
static bool mustPreserveGV(const GlobalValue &GV)
Predicate for Internalize pass.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
void parseCodeGenDebugOptions()
Parse the options set in setCodeGenDebugOptions.
CodeGenOpt::Level CGOptLevel
cl::opt< std::string > LTOStatsFile("lto-stats-file", cl::desc("Save statistics to the specified file"), cl::Hidden)
Basic diagnostic printer that uses an underlying raw_ostream.
A raw_ostream that writes to an std::string.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
cl::opt< std::string > RemarksFilename("lto-pass-remarks-output", cl::desc("Output filename for pass remarks"), cl::value_desc("filename"))
LTOCodeGenerator(LLVMContext &Context)
Triple - Helper class for working with autoconf configuration names.
void setDebugInfo(lto_debug_model)
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
void setTargetOptions(const TargetOptions &Options)
static void externalize(GlobalValue *GV)
This is the base class for diagnostic handling in LLVM.
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
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...
cl::opt< bool > RemarksWithHotness("lto-pass-remarks-with-hotness", cl::desc("With PGO, include profile count in optimization remarks"), cl::Hidden)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
std::pair< typename Base::iterator, bool > insert(StringRef key)
iterator find(StringRef Key)
bool CodeGenOnly
Disable entirely the optimizer, including importing for ThinLTO.
void setOptLevel(unsigned OptLevel)
static const Target * lookupTarget(const std::string &Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
__FakeVCSRevision h endif() endif() set(generated_files "$
Expected< std::unique_ptr< ToolOutputFile > > setupStatsFile(StringRef StatsFilename)
Setups the output file for saving statistics.
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
bool isArch64Bit() const
Test whether the architecture is 64-bit.
bool addModule(struct LTOModule *)
Merge given module.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
bool RunCSIRInstr
Run PGO context sensitive IR instrumentation.
bool AreStatisticsEnabled()
Check if statistics are enabled.
std::unique_ptr< MemoryBuffer > compile()
As with compile_to_file(), this function compiles the merged module into single output file.
bool has_error() const
Return the value of the flag in this raw_fd_ostream indicating whether an output error has been encou...
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, or DriverKit).
void clear_error()
Set the flag read by has_error() to false.
cl::opt< bool > LTODiscardValueNames("lto-discard-value-names", cl::desc("Strip names from Value during LTO (other than GlobalValue)."), cl::init(false), cl::Hidden)
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
std::function< void(legacy::PassManager &)> PreCodeGenPassesHook
For adding passes that run right before codegen.
bool ParseCommandLineOptions(int argc, const char *const *argv, StringRef Overview="", raw_ostream *Errs=nullptr, const char *EnvVar=nullptr, bool LongOptionsUseDoubleDash=false)
std::error_code real_path(const Twine &path, SmallVectorImpl< char > &output, bool expand_tilde=false)
Collapse all .
Manages the enabling and disabling of subtarget specific features.
std::error_code getError() const
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
std::unique_ptr< MemoryBuffer > compileOptimized()
Compiles the merged optimized module into a single output file.
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
void appendToCompilerUsed(Module &M, ArrayRef< GlobalValue * > Values)
Adds global values to the llvm.compiler.used list.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
DiagnosticSeverity getSeverity() const
bool optimize()
Optimizes the merged module.
This is the base abstract class for diagnostic reporting in the backend.
Interface for custom diagnostic printing.
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
bool isOSAIX() const
Tests whether the OS is AIX.
ArchType getArch() const
Get the parsed architecture type of this triple.
std::string StatsFile
Statistics output file path.
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"))
void DiagnosticHandler(const DiagnosticInfo &DI)
An efficient, type-erasing, non-owning reference to a callable.
static const char * getVersionString()
void PrintStatisticsJSON(raw_ostream &OS)
Print statistics in JSON format.
Error backend(const Config &C, AddStreamFn AddStream, unsigned ParallelCodeGenParallelismLevel, Module &M, ModuleSummaryIndex &CombinedIndex)
Runs a regular LTO backend.
void parseCommandLineOptions(std::vector< std::string > &Options)
A convenience function that calls cl::ParseCommandLineOptions on the given set of options.
UnaryFunction for_each(R &&Range, UnaryFunction F)
Provide wrappers to std::for_each which take ranges instead of having to pass begin/end explicitly.
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
This is an important class for using LLVM in a threaded context.
C++ class which implements the opaque lto_code_gen_t type.
initializer< Ty > init(const Ty &Val)
void setFileType(CodeGenFileType FT)
Set the file type to be emitted (assembly or object code).
std::function< Expected< std::unique_ptr< CachedFileStream > >(unsigned Task, const Twine &ModuleName)> AddStreamFn
This type defines the callback to add a file that is generated on the fly.
std::optional< Level > getLevel(IDType ID)
Get the Level identified by the integer ID.
TargetMachine * createTargetMachine(StringRef TT, StringRef CPU, StringRef Features, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM=std::nullopt, CodeGenOpt::Level OL=CodeGenOpt::Default, bool JIT=false) const
createTargetMachine - Create a target specific machine implementation for the specified Triple.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool SLPVectorization
Tuning option to enable/disable slp loop vectorization, set based on opt level.
void(* lto_diagnostic_handler_t)(lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt)
Diagnostic handler type.
std::vector< std::string > MAttrs
A Module instance is used to store all the information related to an LLVM module.
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...
std::optional< CodeModel::Model > CodeModel
void PrintStatistics()
Print statistics to the file returned by CreateInfoOutputFile().
This class provides the core functionality of linking in LLVM.
bool internalizeModule(Module &TheModule, std::function< bool(const GlobalValue &)> MustPreserveGV, CallGraph *CG=nullptr)
Helper function to internalize functions and variables in a Module.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
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.
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
cl::opt< std::string > AIXSystemAssemblerPath("lto-aix-system-assembler", cl::desc("Path to a system assembler, picked up on AIX only"), cl::value_desc("path"))
std::error_code error() const
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.
std::string getDefaultTargetTriple()
getDefaultTargetTriple() - Return the default target triple the compiler has been configured to produ...
void setModule(std::unique_ptr< LTOModule > M)
Set the destination module.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
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...
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
StringRef - Represent a constant reference to a string, i.e.
static std::optional< std::string > GetEnv(StringRef name)
So we should use XX3Form_Rcr to implement intrinsic 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
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool LoopVectorization
Tuning option to enable/disable loop vectorization, set based on opt level.
@ Error
Emits an error if two values disagree, otherwise the resulting value is that of the operands.
A raw_ostream that writes to a file descriptor.
std::optional< Reloc::Model > RelocModel
const CustomOperand< const MCSubtargetInfo & > Msg[]
bool writeMergedModules(StringRef Path)
Write the merged module to the file specified by the given path.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
cl::opt< std::string > LTOCSIRProfile("cs-profile-path", cl::desc("Context sensitive profile file path"))
const char * toString(DWARFSectionKind Kind)
std::optional< bool > getExplicitDataSections()
Lightweight error class with error context and mandatory checking.
PassManager manages ModulePassManagers.
LLVMContext & getContext() const
Get the global data context.
cl::opt< bool > LTORunCSIRInstr("cs-profile-generate", cl::desc("Perform context sensitive PGO instrumentation"))
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
unsigned DataSections
Emit data into separate sections.
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
PipelineTuningOptions PTO
Tunable parameters for passes in the default pipelines.
std::string CSIRProfile
Context Sensitive PGO profile path.
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
CodeGenFileType CGFileType
void updatePublicTypeTestCalls(Module &M, bool WholeProgramVisibilityEnabledInLTO)
Class to hold module path string table and global value map, and encapsulate methods for operating on...
Represents either an error or a value T.
cl::opt< std::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)
int ExecuteAndWait(StringRef Program, ArrayRef< StringRef > Args, std::optional< ArrayRef< StringRef >> Env=std::nullopt, ArrayRef< std::optional< StringRef >> Redirects={}, unsigned SecondsToWait=0, unsigned MemoryLimit=0, std::string *ErrMsg=nullptr, bool *ExecutionFailed=nullptr, std::optional< ProcessStatistics > *ProcStat=nullptr, BitVector *AffinityMask=nullptr)
This function executes the program using the arguments provided.
void setAsmUndefinedRefs(struct LTOModule *)
Pass * createObjCARCContractPass()
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
void reserve(size_type N)
C++ class which implements the opaque lto_module_t type.
bool verifyModule(const Module &M, raw_ostream *OS=nullptr, bool *BrokenDebugInfo=nullptr)
Check a module for errors.