LLVM  15.0.0git
LLVMTargetMachine.cpp
Go to the documentation of this file.
1 //===-- LLVMTargetMachine.cpp - Implement the LLVMTargetMachine class -----===//
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 LLVMTargetMachine class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/Analysis/Passes.h"
17 #include "llvm/CodeGen/Passes.h"
20 #include "llvm/MC/MCAsmBackend.h"
21 #include "llvm/MC/MCAsmInfo.h"
22 #include "llvm/MC/MCCodeEmitter.h"
23 #include "llvm/MC/MCContext.h"
24 #include "llvm/MC/MCInstrInfo.h"
25 #include "llvm/MC/MCObjectWriter.h"
26 #include "llvm/MC/MCRegisterInfo.h"
27 #include "llvm/MC/MCStreamer.h"
29 #include "llvm/MC/TargetRegistry.h"
34 using namespace llvm;
35 
36 static cl::opt<bool>
37  EnableTrapUnreachable("trap-unreachable", cl::Hidden,
38  cl::desc("Enable generating trap for unreachable"));
39 
42  assert(MRI && "Unable to create reg info");
44  assert(MII && "Unable to create instruction info");
45  // FIXME: Having an MCSubtargetInfo on the target machine is a hack due
46  // to some backends having subtarget feature dependent module level
47  // code generation. This is similar to the hack in the AsmPrinter for
48  // module level assembly etc.
51  assert(STI && "Unable to create subtarget info");
52 
53  MCAsmInfo *TmpAsmInfo = TheTarget.createMCAsmInfo(
55  // TargetSelect.h moved to a different directory between LLVM 2.9 and 3.0,
56  // and if the old one gets included then MCAsmInfo will be NULL and
57  // we'll crash later.
58  // Provide the user with a useful error message about what's wrong.
59  assert(TmpAsmInfo && "MCAsmInfo not initialized. "
60  "Make sure you include the correct TargetSelect.h"
61  "and that InitializeAllTargetMCs() is being invoked!");
62 
63  if (Options.BinutilsVersion.first > 0)
65 
67  TmpAsmInfo->setUseIntegratedAssembler(false);
68  // If there is explict option disable integratedAS, we can't use it for
69  // inlineasm either.
70  TmpAsmInfo->setParseInlineAsmUsingAsmParser(false);
71  }
72 
74 
76 
78 
81 
82  AsmInfo.reset(TmpAsmInfo);
83 }
84 
86  StringRef DataLayoutString,
87  const Triple &TT, StringRef CPU,
91  : TargetMachine(T, DataLayoutString, TT, CPU, FS, Options) {
92  this->RM = RM;
93  this->CMModel = CM;
94  this->OptLevel = OL;
95 
97  this->Options.TrapUnreachable = true;
98 }
99 
102  return TargetTransformInfo(BasicTTIImpl(this, F));
103 }
104 
105 /// addPassesToX helper drives creation and initialization of TargetPassConfig.
106 static TargetPassConfig *
108  bool DisableVerify,
110  // Targets may override createPassConfig to provide a target-specific
111  // subclass.
112  TargetPassConfig *PassConfig = TM.createPassConfig(PM);
113  // Set PassConfig options provided by TargetMachine.
114  PassConfig->setDisableVerify(DisableVerify);
115  PM.add(PassConfig);
116  PM.add(&MMIWP);
117 
118  if (PassConfig->addISelPasses())
119  return nullptr;
120  PassConfig->addMachinePasses();
121  PassConfig->setInitialized();
122  return PassConfig;
123 }
124 
126  raw_pwrite_stream &Out,
127  raw_pwrite_stream *DwoOut,
129  MCContext &Context) {
130  Expected<std::unique_ptr<MCStreamer>> MCStreamerOrErr =
131  createMCStreamer(Out, DwoOut, FileType, Context);
132  if (auto Err = MCStreamerOrErr.takeError())
133  return true;
134 
135  // Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
137  getTarget().createAsmPrinter(*this, std::move(*MCStreamerOrErr));
138  if (!Printer)
139  return true;
140 
141  PM.add(Printer);
142  return false;
143 }
144 
147  MCContext &Context) {
149  Context.setAllowTemporaryLabels(false);
150 
152  const MCAsmInfo &MAI = *getMCAsmInfo();
154  const MCInstrInfo &MII = *getMCInstrInfo();
155 
156  std::unique_ptr<MCStreamer> AsmStreamer;
157 
158  switch (FileType) {
159  case CGFT_AssemblyFile: {
161  getTargetTriple(), MAI.getAssemblerDialect(), MAI, MII, MRI);
162 
163  // Create a code emitter if asked to show the encoding.
164  std::unique_ptr<MCCodeEmitter> MCE;
166  MCE.reset(getTarget().createMCCodeEmitter(MII, Context));
167 
168  bool UseDwarfDirectory = false;
171  UseDwarfDirectory = false;
172  break;
174  UseDwarfDirectory = true;
175  break;
177  UseDwarfDirectory = MAI.enableDwarfFileDirectoryDefault();
178  break;
179  }
180 
181  std::unique_ptr<MCAsmBackend> MAB(
182  getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions));
183  auto FOut = std::make_unique<formatted_raw_ostream>(Out);
186  UseDwarfDirectory, InstPrinter, std::move(MCE), std::move(MAB),
188  AsmStreamer.reset(S);
189  break;
190  }
191  case CGFT_ObjectFile: {
192  // Create the code emitter for the target if it exists. If not, .o file
193  // emission fails.
195  if (!MCE)
196  return make_error<StringError>("createMCCodeEmitter failed",
198  MCAsmBackend *MAB =
200  if (!MAB)
201  return make_error<StringError>("createMCAsmBackend failed",
203 
204  Triple T(getTargetTriple().str());
205  AsmStreamer.reset(getTarget().createMCObjectStreamer(
206  T, Context, std::unique_ptr<MCAsmBackend>(MAB),
207  DwoOut ? MAB->createDwoObjectWriter(Out, *DwoOut)
208  : MAB->createObjectWriter(Out),
209  std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll,
211  /*DWARFMustBeAtTheEnd*/ true));
212  break;
213  }
214  case CGFT_Null:
215  // The Null output is intended for use for performance analysis and testing,
216  // not real users.
217  AsmStreamer.reset(getTarget().createNullStreamer(Context));
218  break;
219  }
220 
221  return std::move(AsmStreamer);
222 }
223 
226  CodeGenFileType FileType, bool DisableVerify,
228  // Add common CodeGen passes.
229  if (!MMIWP)
230  MMIWP = new MachineModuleInfoWrapperPass(this);
231  TargetPassConfig *PassConfig =
232  addPassesToGenerateCode(*this, PM, DisableVerify, *MMIWP);
233  if (!PassConfig)
234  return true;
235 
237  if (addAsmPrinter(PM, Out, DwoOut, FileType, MMIWP->getMMI().getContext()))
238  return true;
239  } else {
240  // MIR printing is redundant with -filetype=null.
241  if (FileType != CGFT_Null)
242  PM.add(createPrintMIRPass(Out));
243  }
244 
246  return false;
247 }
248 
249 /// addPassesToEmitMC - Add passes to the specified pass manager to get
250 /// machine code emitted with the MCJIT. This method returns true if machine
251 /// code is not supported. It fills the MCContext Ctx pointer which can be
252 /// used to build custom MCStreamer.
253 ///
255  raw_pwrite_stream &Out,
256  bool DisableVerify) {
257  // Add common CodeGen passes.
259  TargetPassConfig *PassConfig =
260  addPassesToGenerateCode(*this, PM, DisableVerify, *MMIWP);
261  if (!PassConfig)
262  return true;
264  "Cannot emit MC with limited codegen pipeline");
265 
266  Ctx = &MMIWP->getMMI().getContext();
267  // libunwind is unable to load compact unwind dynamically, so we must generate
268  // DWARF unwind info for the JIT.
271  Ctx->setAllowTemporaryLabels(false);
272 
273  // Create the code emitter for the target if it exists. If not, .o file
274  // emission fails.
278  MCAsmBackend *MAB =
280  if (!MCE || !MAB)
281  return true;
282 
283  const Triple &T = getTargetTriple();
284  std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer(
285  T, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), MAB->createObjectWriter(Out),
286  std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll,
288  /*DWARFMustBeAtTheEnd*/ true));
289 
290  // Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
292  getTarget().createAsmPrinter(*this, std::move(AsmStreamer));
293  if (!Printer)
294  return true;
295 
296  PM.add(Printer);
298 
299  return false; // success!
300 }
AsmPrinter.h
llvm::MCAsmInfo::setRelaxELFRelocations
void setRelaxELFRelocations(bool V)
Definition: MCAsmInfo.h:876
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::TargetMachine::STI
std::unique_ptr< const MCSubtargetInfo > STI
Definition: TargetMachine.h:108
llvm::MachineModuleInfo::getContext
const MCContext & getContext() const
Definition: MachineModuleInfo.h:144
llvm::CGFT_ObjectFile
@ CGFT_ObjectFile
Definition: CodeGen.h:65
llvm::TargetOptions
Definition: TargetOptions.h:124
llvm::TargetPassConfig::willCompleteCodeGenPipeline
static bool willCompleteCodeGenPipeline()
Returns true if none of the -stop-before and -stop-after options is set.
Definition: TargetPassConfig.cpp:674
T
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:76
llvm::Function
Definition: Function.h:60
llvm::TargetMachine::TheTarget
const Target & TheTarget
The Target that this machine was created for.
Definition: TargetMachine.h:84
MCCodeEmitter.h
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:145
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
llvm::Target::createMCAsmInfo
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple, const MCTargetOptions &Options) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
Definition: TargetRegistry.h:402
llvm::TargetMachine::getMCRegisterInfo
const MCRegisterInfo * getMCRegisterInfo() const
Definition: TargetMachine.h:207
llvm::TargetTransformInfo
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Definition: TargetTransformInfo.h:168
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:139
llvm::CGFT_Null
@ CGFT_Null
Definition: CodeGen.h:66
llvm::TargetOptions::TrapUnreachable
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
Definition: TargetOptions.h:280
llvm::TargetMachine::MII
std::unique_ptr< const MCInstrInfo > MII
Definition: TargetMachine.h:107
llvm::MachineModuleInfoWrapperPass::getMMI
MachineModuleInfo & getMMI()
Definition: MachineModuleInfo.h:229
llvm::TargetMachine::RM
Reloc::Model RM
Definition: TargetMachine.h:100
llvm::TargetOptions::CompressDebugSections
DebugCompressionType CompressDebugSections
Compress DWARF debug sections.
Definition: TargetOptions.h:258
llvm::Target::createAsmStreamer
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool IsVerboseAsm, bool UseDwarfDirectory, MCInstPrinter *InstPrint, std::unique_ptr< MCCodeEmitter > &&CE, std::unique_ptr< MCAsmBackend > &&TAB, bool ShowInst) const
Definition: TargetRegistry.h:620
llvm::MCAsmInfo::getAssemblerDialect
unsigned getAssemblerDialect() const
Definition: MCAsmInfo.h:684
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::MCAsmBackend::createDwoObjectWriter
std::unique_ptr< MCObjectWriter > createDwoObjectWriter(raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS) const
Create an MCObjectWriter that writes two object files: a .o file which is linked into the final progr...
Definition: MCAsmBackend.cpp:62
LegacyPassManager.h
llvm::Target::createMCInstrInfo
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
Definition: TargetRegistry.h:424
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::Reloc::Model
Model
Definition: CodeGen.h:22
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::Target::createMCRegInfo
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
Definition: TargetRegistry.h:440
llvm::Target::createMCCodeEmitter
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
Definition: TargetRegistry.h:530
CommandLine.h
FormattedStream.h
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
Printer
print alias Alias Set Printer
Definition: AliasSetTracker.cpp:733
llvm::MCAsmInfo::setExceptionsType
void setExceptionsType(ExceptionHandling EH)
Definition: MCAsmInfo.h:780
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:42
TargetMachine.h
MCAsmBackend.h
llvm::MCTargetOptions::ShowMCEncoding
bool ShowMCEncoding
Definition: MCTargetOptions.h:57
llvm::TargetPassConfig::setDisableVerify
void setDisableVerify(bool Disable)
Definition: TargetPassConfig.h:174
MCContext.h
MCInstrInfo.h
llvm::MCAsmInfo::enableDwarfFileDirectoryDefault
bool enableDwarfFileDirectoryDefault() const
Definition: MCAsmInfo.h:821
llvm::TargetOptions::MCOptions
MCTargetOptions MCOptions
Machine level options.
Definition: TargetOptions.h:442
llvm::TargetOptions::ExceptionModel
ExceptionHandling ExceptionModel
What exception model to use.
Definition: TargetOptions.h:439
llvm::MCTargetOptions::MCUseDwarfDirectory
DwarfDirectory MCUseDwarfDirectory
Definition: MCTargetOptions.h:79
MCSubtargetInfo.h
llvm::MCContext::setAllowTemporaryLabels
void setAllowTemporaryLabels(bool Value)
Definition: MCContext.h:453
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::LLVMTargetMachine::addPassesToEmitFile
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, bool DisableVerify=true, MachineModuleInfoWrapperPass *MMIWP=nullptr) override
Add passes to the specified pass manager to get the specified file emitted.
Definition: LLVMTargetMachine.cpp:224
llvm::TargetOptions::RelaxELFRelocations
unsigned RelaxELFRelocations
Definition: TargetOptions.h:260
addPassesToGenerateCode
static TargetPassConfig * addPassesToGenerateCode(LLVMTargetMachine &TM, PassManagerBase &PM, bool DisableVerify, MachineModuleInfoWrapperPass &MMIWP)
addPassesToX helper drives creation and initialization of TargetPassConfig.
Definition: LLVMTargetMachine.cpp:107
llvm::TargetMachine::getMCInstrInfo
const MCInstrInfo * getMCInstrInfo() const
Definition: TargetMachine.h:208
llvm::MCAsmInfo::setUseIntegratedAssembler
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:848
llvm::legacy::PassManagerBase::add
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
llvm::MachO::FileType
FileType
Defines the file type this file represents.
Definition: InterfaceFile.h:53
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
Passes.h
llvm::TargetPassConfig
Target-Independent Code Generator Pass Configuration Options.
Definition: TargetPassConfig.h:84
llvm::LLVMTargetMachine::addPassesToEmitMC
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, raw_pwrite_stream &Out, bool DisableVerify=true) override
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
Definition: LLVMTargetMachine.cpp:254
llvm::MCTargetOptions::EmitDwarfUnwind
EmitDwarfUnwindType EmitDwarfUnwind
Definition: MCTargetOptions.h:66
llvm::cl::opt< bool >
llvm::TargetPassConfig::addMachinePasses
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
Definition: TargetPassConfig.cpp:1149
llvm::LLVMTargetMachine::LLVMTargetMachine
LLVMTargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Definition: LLVMTargetMachine.cpp:85
llvm::MCTargetOptions::MCIncrementalLinkerCompatible
bool MCIncrementalLinkerCompatible
Definition: MCTargetOptions.h:56
llvm::raw_pwrite_stream
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:418
llvm::LLVMTargetMachine::getTargetTransformInfo
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
Definition: LLVMTargetMachine.cpp:101
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
llvm::MachineModuleInfoWrapperPass
Definition: MachineModuleInfo.h:215
llvm::createPrintMIRPass
MachineFunctionPass * createPrintMIRPass(raw_ostream &OS)
MIRPrinting pass - this pass prints out the LLVM IR into the given stream using the MIR serialization...
Definition: MIRPrintingPass.cpp:66
llvm::TargetMachine::getMCSubtargetInfo
const MCSubtargetInfo * getMCSubtargetInfo() const
Definition: TargetMachine.h:209
EnableTrapUnreachable
static cl::opt< bool > EnableTrapUnreachable("trap-unreachable", cl::Hidden, cl::desc("Enable generating trap for unreachable"))
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::TargetMachine::OptLevel
CodeGenOpt::Level OptLevel
Definition: TargetMachine.h:102
llvm::createNullStreamer
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
Definition: MCNullStreamer.cpp:56
MCRegisterInfo.h
TargetPassConfig.h
llvm::TargetMachine::Options
TargetOptions Options
Definition: TargetMachine.h:118
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::X86AS::FS
@ FS
Definition: X86.h:192
llvm::Target::createAsmPrinter
AsmPrinter * createAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
createAsmPrinter - Create a target specific assembly printer pass.
Definition: TargetRegistry.h:506
llvm::MCTargetOptions::EnableDwarfDirectory
@ EnableDwarfDirectory
Definition: MCTargetOptions.h:75
llvm::TargetPassConfig::setInitialized
void setInitialized()
Definition: TargetPassConfig.h:156
MachineModuleInfo.h
llvm::TargetPassConfig::addISelPasses
bool addISelPasses()
High level function that adds all passes necessary to go from llvm IR representation to the MI repres...
Definition: TargetPassConfig.cpp:1110
llvm::MCAsmInfo::setParseInlineAsmUsingAsmParser
virtual void setParseInlineAsmUsingAsmParser(bool Value)
Set whether target want to use AsmParser to parse inlineasm.
Definition: MCAsmInfo.h:853
llvm::createFreeMachineFunctionPass
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
Definition: MachineModuleInfo.cpp:175
TargetOptions.h
llvm::AArch64::RM
@ RM
Definition: AArch64ISelLowering.h:469
llvm::TargetMachine::getMCAsmInfo
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
Definition: TargetMachine.h:205
llvm::Target::createMCAsmBackend
MCAsmBackend * createMCAsmBackend(const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options) const
createMCAsmBackend - Create a target specific assembly parser.
Definition: TargetRegistry.h:483
MCAsmInfo.h
llvm::CodeGenFileType
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
Definition: CodeGen.h:63
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::TargetOptions::BinutilsVersion
std::pair< int, int > BinutilsVersion
If greater than 0, override the default value of MCAsmInfo::BinutilsVersion.
Definition: TargetOptions.h:156
llvm::TargetMachine::getTargetFeatureString
StringRef getTargetFeatureString() const
Definition: TargetMachine.h:128
llvm::MCTargetOptions::ShowMCInst
bool ShowMCInst
Definition: MCTargetOptions.h:58
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::LLVMTargetMachine::initAsmInfo
void initAsmInfo()
Definition: LLVMTargetMachine.cpp:40
llvm::MCAsmInfo::setBinutilsVersion
void setBinutilsVersion(std::pair< int, int > Value)
Definition: MCAsmInfo.h:831
MCObjectWriter.h
llvm::Target::createMCSubtargetInfo
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
Definition: TargetRegistry.h:455
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
llvm::Target::createMCInstPrinter
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
Definition: TargetRegistry.h:520
llvm::BasicTTIImpl
Concrete BasicTTIImpl that can be used if no further customization is needed.
Definition: BasicTTIImpl.h:2345
llvm::inconvertibleErrorCode
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition: Error.cpp:77
llvm::MCTargetOptions::DefaultDwarfDirectory
@ DefaultDwarfDirectory
Definition: MCTargetOptions.h:77
llvm::MCCodeEmitter
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
llvm::MCTargetOptions::DisableDwarfDirectory
@ DisableDwarfDirectory
Definition: MCTargetOptions.h:72
llvm::MCTargetOptions::MCRelaxAll
bool MCRelaxAll
Definition: MCTargetOptions.h:49
llvm::MCTargetOptions::AsmVerbose
bool AsmVerbose
Definition: MCTargetOptions.h:59
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:411
llvm::MCAsmInfo::setCompressDebugSections
void setCompressDebugSections(DebugCompressionType CompressDebugSections)
Definition: MCAsmInfo.h:869
llvm::ExceptionHandling::None
@ None
No exception support.
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:597
llvm::TargetMachine::CMModel
CodeModel::Model CMModel
Definition: TargetMachine.h:101
llvm::TargetMachine::getTargetCPU
StringRef getTargetCPU() const
Definition: TargetMachine.h:127
llvm::MCAsmBackend::createObjectWriter
std::unique_ptr< MCObjectWriter > createObjectWriter(raw_pwrite_stream &OS) const
Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.
Definition: MCAsmBackend.cpp:32
llvm::MCTargetOptions::MCSaveTempLabels
bool MCSaveTempLabels
Definition: MCTargetOptions.h:55
MCStreamer.h
llvm::TargetMachine::AsmInfo
std::unique_ptr< const MCAsmInfo > AsmInfo
Contains target specific asm information.
Definition: TargetMachine.h:105
llvm::TargetMachine::getTargetTriple
const Triple & getTargetTriple() const
Definition: TargetMachine.h:126
llvm::MCAsmInfo::setPreserveAsmComments
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:861
llvm::legacy::PassManagerBase
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Definition: LegacyPassManager.h:39
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::MCTargetOptions::PreserveAsmComments
bool PreserveAsmComments
Preserve Comments in Assembly.
Definition: MCTargetOptions.h:62
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:308
llvm::EmitDwarfUnwindType::Always
@ Always
llvm::TargetOptions::DisableIntegratedAS
unsigned DisableIntegratedAS
Disable the integrated assembler.
Definition: TargetOptions.h:255
BasicTTIImpl.h
llvm::cl::desc
Definition: CommandLine.h:405
llvm::TargetMachine::getTarget
const Target & getTarget() const
Definition: TargetMachine.h:124
llvm::CGFT_AssemblyFile
@ CGFT_AssemblyFile
Definition: CodeGen.h:64
TargetRegistry.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
llvm::TargetMachine::MRI
std::unique_ptr< const MCRegisterInfo > MRI
Definition: TargetMachine.h:106
llvm::LLVMTargetMachine::createMCStreamer
Expected< std::unique_ptr< MCStreamer > > createMCStreamer(raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Ctx)
Definition: LLVMTargetMachine.cpp:145
llvm::MCStreamer::reset
virtual void reset()
State management.
Definition: MCStreamer.cpp:102
llvm::LLVMTargetMachine::addAsmPrinter
bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Context)
Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representati...
Definition: LLVMTargetMachine.cpp:125
Passes.h