Primary interface to the complete machine description for the target machine. All target‐specific information should be accessible through this interface.

Synopsis

Declared in <llvm/Target/TargetMachine.h>

class TargetMachine;

Member Functions

Name

Description

TargetMachine [constructor] [deleted]

Deleted copy constructor; TargetMachine is not copyable.

~TargetMachine [destructor] [virtual]

Destroy this TargetMachine and release owned MC objects.

operator= [deleted]

Deleted copy assignment; TargetMachine is not copyable.

addAsmPrinter [virtual]

Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representation.

addPassesToEmitFile [virtual]

Add passes to emit the specified file type from the pass manager.

addPassesToEmitMC [virtual]

Add passes to emit machine code for MCJIT.

buildCodeGenPipeline [virtual]

Build the new‐pass‐manager code generation pipeline for this target.

canLowerCondLoop [virtual]

Return whether the backend can lower the llvm.cond.loop intrinsic.

clearLinkerOptimizationHints [virtual]

Remove all Linker Optimization Hints (LOH) associated with instructions in MIs and

convertFuncInfoToYAML [virtual]

Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.

createDataLayout

Create a DataLayout.

createDefaultFuncInfoYAML [virtual]

Allocate and return a default initialized instance of the YAML representation for the MachineFunctionInfo.

createMCStreamer [virtual]

Create an MCStreamer for the given output streams and file type.

createMachineFunctionInfo [virtual]

Create the target's instance of MachineFunctionInfo.

createMachineScheduler [virtual]

Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this function and target at the current optimization level.

createPassConfig [virtual]

Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of CodeGen passes.

createPostMachineScheduler [virtual]

Similar to createMachineScheduler but used when postRA machine scheduling is enabled.

getAIXExtendedAltivecABI

Return true if the AIX extended Altivec ABI is enabled.

getAddressSpaceForPseudoSourceKind [virtual]

Return the address space for a given pseudo source kind of memory.

getAllocaPointerSize

Return the pointer size of the alloca address space.

getAssumedAddrSpace [virtual]

If the specified generic pointer could be assumed as a pointer to a specific address space, return that address space.

getBBSectionsFuncListBuf

Get the list of functions and basic block ids that need unique sections.

getBBSectionsType

Return how basic blocks should be emitted into their own sections.

getCodeModel

Returns the code model. The choices are small, kernel, medium, large, and target default.

getDataSections

Return true if data objects should be emitted into their own section, corresponds to ‐fdata‐sections.

getEnableStaticDataPartitioning

Return true if static data partitioning is enabled.

getExceptionModel

Return the ExceptionHandling to use, considering TargetOptions and the Triple's default.

getFunctionSections

Return true if functions should be emitted into their own section, corresponding to ‐ffunction‐sections.

getIgnoreXCOFFVisibility

Return true if visibility attribute should not be emitted in XCOFF, corresponding to ‐mignore‐xcoff‐visibility.

getMCAsmInfo

Return target specific asm information.

getMCInstrInfo

Return the target‐specific MC instruction information.

getMCRegisterInfo

Return the target‐specific MC register information.

getMCSubtargetInfo

getMCSubtargetInfo overloads

getMaxCodeSize

Returns the maximum code size possible under the code model.

getNameWithPrefix

Append the mangled name of GV to Name.

getO0WantsFastISel

Return true if ‐O0 should prefer FastISel when available.

getObjFileLowering [virtual]

Return the target object‐file lowering helper, if any.

getOptLevel

Returns the optimization level: None, Less, Default, or Aggressive.

getPGOOption

Return the profile‐guided optimization options for this machine.

getPointerSize

Get the pointer size for this target.

getPointerSizeInBits

Return the pointer size in bits for the given address space.

getPredicatedAddrSpace [virtual]

Return the generic pointer and address space queried by a predicate.

getProgramPointerSize

Return the pointer size of the program address space.

getRelocationModel

Returns the code generation relocation model. The choices are static, PIC, and dynamic‐no‐pic, and target default.

getSeparateNamedSections

Return true if named sections should be emitted separately.

getSjLjDataSize [virtual]

Return the integer bit size used for SjLj‐based exception handling.

getSubtarget

This method returns a pointer to the specified type of TargetSubtargetInfo. In debug builds, it verifies that the object being returned is of the correct type.

getSubtargetImpl [virtual]

Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInfo‐derived member variable.

getSymbol

Return the MCSymbol for the given global value.

getTLSModel

Returns the TLS model which should be used for the given global variable.

getTarget

Return the Target this machine was created for.

getTargetABIName

Return the effective target ABI name for the module.

getTargetCPU

Return the target CPU name this machine was created with.

getTargetFeatureString

Return the target feature string this machine was created with.

getTargetIRAnalysis

Get a TargetIRAnalysis appropriate for the target.

getTargetTransformInfo [virtual]

Return a TargetTransformInfo for a given function.

getTargetTriple

Return the target triple this machine was created with.

getUniqueBasicBlockSectionNames

Return true if unique basic block section names must be generated.

getUniqueSectionNames

Return true if unique section names should be used.

getXCOFFTracebackTable

Return true if XCOFF traceback table should be emitted, corresponding to ‐xcoff‐traceback‐table.

isCompatibleDataLayout

Test if a DataLayout if compatible with the CodeGen for this target.

isLargeDataSize

Return true if a data object of Size should be treated as large.

isLargeGlobalValue

Return true if GV should be treated as a large global value.

isMachineVerifierClean [virtual]

Return true if the target is expected to pass machine verifier checks.

isNoopAddrSpaceCast [virtual]

Returns true if a cast between SrcAS and DestAS is a noop.

isPositionIndependent

Return true if code generation uses a position‐independent model.

parseMachineFunctionInfo [virtual]

Parse out the target's MachineFunctionInfo from the YAML reprsentation.

registerDefaultAliasAnalyses [virtual]

Allow the target to register alias analyses with the AAManager for use with the new pass manager. Only affects the "default" AAManager.

registerEarlyDefaultAliasAnalyses [virtual]

Register early alias analyses with the default AAManager.

registerMachineRegisterInfoCallback [virtual]

Register a MachineRegisterInfo callback for the given machine function.

registerPassBuilderCallbacks [virtual]

Allow the target to modify the pass pipeline.

requiresStructuredCFG

Return true if the target requires a structured CFG.

setCFIFixup

Enable or disable CFI fixup for this target machine.

setCodeModel

Set the code model.

setEnableDefaultMachineVerifier

Enable or disable the default machine verifier.

setFastISel

Enable or disable FastISel for this target machine.

setGlobalISel

Enable or disable GlobalISel for this target machine.

setGlobalISelAbort

Set how GlobalISel aborts on failure.

setLargeDataThreshold

Set the large‐data threshold used with the code model.

setMachineOutliner

Enable or disable the machine outliner.

setO0WantsFastISel

Set whether ‐O0 should prefer FastISel when available.

setOptLevel

Overrides the optimization level.

setPGOOption

Set the profile‐guided optimization options for this machine.

setRequiresStructuredCFG

Set whether the target requires a structured CFG.

setSupportsDebugEntryValues

Set whether the target supports debug entry values by default.

setSupportsDefaultOutlining

Set whether the target supports default outlining.

setTargetFeatureString

Set the target feature string used by this machine.

shouldAssumeDSOLocal

Return true if references to GV may assume DSO‐local binding.

shouldDefaultToNewPM [virtual]

Returns true if frontends should default to using the NewPM for this specific target.

splitModule [virtual]

Entry point for module splitting. Targets can implement custom module splitting logic, mainly used by LTO for ‐‐lto‐partitions.

targetSchedulesPostRAScheduling [virtual]

True if subtarget inserts the final scheduling pass on its own.

unqualifiedInlineAsmVariant [virtual]

The default variant to use in unqualified asm instructions.

useEmulatedTLS

Returns true if this target uses emulated TLS.

useIPRA [virtual]

True if the target wants to use interprocedural register allocation by default.

useTLSDESC

Returns true if this target uses TLS Descriptors.

usesPhysRegsForValues [virtual]

Return true if the target uses physical registers for values.

verifyOptionsConsistency

Diagnose conflicting command‐line codegen options and module flags.

Static Member Functions

Name

Description

parseBinutilsVersion

Parse a binutils version string into a major/minor pair.

Data Members

Name

Description

Options

Target‐specific code generation options for this machine.

Static Data Members

Name

Description

DefaultSjLjDataSize

The integer bit size to use for SjLj based exception handling.

Protected Member Functions

Name

Description

TargetMachine [constructor]

Construct a TargetMachine for the given target and configuration.

Protected Data Members

Name

Description

AsmInfo

Contains target specific asm information.

CMModel

Code model used for code generation.

DL

DataLayout for the target: keep ABI type size and alignment.

LargeDataThreshold

Threshold above which data is considered "large" under the code model.

MCSubtargetMap

MC subtarget keyed by target features and target CPU.

MII

Target‐specific MC instruction information.

MRI

Target‐specific MC register information.

O0WantsFastISel

Whether ‐O0 should prefer FastISel when available.

OptLevel

Optimization level used for code generation.

PGOOption

Profile‐guided optimization options for this target machine.

RM

Relocation model used for code generation.

RequireStructuredCFG

Whether the target requires a structured control‐flow graph.

STI

Default MC subtarget information for this machine.

TargetCPU

Target CPU name this machine was created with.

TargetFS

Target feature string this machine was created with.

TargetTriple

Triple string, CPU name, and target feature strings the TargetMachine instance is created with.

TheTarget

The Target that this machine was created for.

Non-Member Functions

Name

Description

createComplexDeinterleavingPass

This pass implements generation of target‐specific intrinsics to support handling of complex number arithmetic

createGlobalMergePass

Create a pass that merges globals to share a base pointer.

createSjLjEHPreparePass

createSjLjEHPreparePass ‐ This pass adapts exception handling code to use the GCC‐style builtin setjmp/longjmp (sjlj) to handling EH control flow.

invokeGlobalTargetPassConfigCallbacks

Invoke every registered PassConfigCallback for the given target setup.

Derived Classes

Name

Description

CodeGenTargetMachineImpl

Implements TargetMachine functionality for CodeGen‐based targets.

Created with MrDocs