|
MLIR 24.0.0git
|
Implementation class for module translation. More...
#include "mlir/Target/LLVMIR/ModuleTranslation.h"
Public Types | |
| template<typename T> | |
| using | SaveStack = SaveStateStack<T, ModuleTranslation> |
| RAII object calling stackPush/stackPop on construction/destruction. | |
Public Member Functions | |
| void | mapFunction (StringRef name, llvm::Function *func) |
| Stores the mapping between a function name and its LLVM IR representation. | |
| llvm::Function * | lookupFunction (StringRef name) const |
| Finds an LLVM IR function by its name. | |
| void | mapValue (Value mlir, llvm::Value *llvm) |
| Stores the mapping between an MLIR value and its LLVM IR counterpart. | |
| llvm::Value *& | mapValue (Value value) |
| Provides write-once access to store the LLVM IR value corresponding to the given MLIR value. | |
| llvm::Value * | lookupValue (Value value) const |
| Finds an LLVM IR value corresponding to the given MLIR value. | |
| SmallVector< llvm::Value * > | lookupValues (ValueRange values) |
| Looks up remapped a list of remapped values. | |
| void | mapBlock (Block *mlir, llvm::BasicBlock *llvm) |
| Stores the mapping between an MLIR block and LLVM IR basic block. | |
| llvm::BasicBlock * | lookupBlock (Block *block) const |
| Finds an LLVM IR basic block that corresponds to the given MLIR block. | |
| llvm::CanonicalLoopInfo * | lookupOMPLoop (omp::NewCliOp mlir) const |
| Find the LLVM-IR loop that represents an MLIR loop. | |
| llvm::CanonicalLoopInfo * | lookupOMPLoop (Value mlir) const |
| Find the LLVM-IR loop that represents an MLIR loop. | |
| void | invalidateOmpLoop (omp::NewCliOp mlir) |
| Mark an OpenMP loop as having been consumed. | |
| void | invalidateOmpLoop (Value mlir) |
| Mark an OpenMP loop as having been consumed. | |
| void | mapOmpLoop (omp::NewCliOp mlir, llvm::CanonicalLoopInfo *llvm) |
| Map an MLIR OpenMP dialect CanonicalLoopInfo to its lowered LLVM-IR OpenMPIRBuilder CanonicalLoopInfo. | |
| void | mapOmpLoop (Value mlir, llvm::CanonicalLoopInfo *llvm) |
| Map an MLIR OpenMP dialect CanonicalLoopInfo to its lowered LLVM-IR OpenMPIRBuilder CanonicalLoopInfo. | |
| void | mapBranch (Operation *mlir, llvm::Instruction *llvm) |
| Stores the mapping between an MLIR operation with successors and a corresponding LLVM IR instruction. | |
| llvm::Instruction * | lookupBranch (Operation *op) const |
| Finds an LLVM IR instruction that corresponds to the given MLIR operation with successors. | |
| void | mapCall (Operation *mlir, llvm::CallInst *llvm) |
| Stores a mapping between an MLIR call operation and a corresponding LLVM call instruction. | |
| llvm::CallInst * | lookupCall (Operation *op) const |
| Finds an LLVM call instruction that corresponds to the given MLIR call operation. | |
| void | mapUnresolvedBlockAddress (BlockAddressOp op, llvm::Value *cst) |
| Maps a blockaddress operation to its corresponding placeholder LLVM value. | |
| void | mapBlockAddress (BlockAddressAttr attr, llvm::BasicBlock *block) |
| Maps a BlockAddressAttr to its corresponding LLVM basic block. | |
| llvm::BasicBlock * | lookupBlockAddress (BlockAddressAttr attr) const |
| Finds the LLVM basic block that corresponds to the given BlockAddressAttr. | |
| void | forgetMapping (Region ®ion) |
| Removes the mapping for blocks contained in the region and values defined in these blocks. | |
| void | forgetMapping (Value value) |
| Removes the mapping for the given value. | |
| llvm::MDNode * | getOrCreateAliasScope (AliasScopeAttr aliasScopeAttr) |
| Returns the LLVM metadata corresponding to a mlir LLVM dialect alias scope attribute. | |
| llvm::MDNode * | getOrCreateAliasScopes (ArrayRef< AliasScopeAttr > aliasScopeAttrs) |
| Returns the LLVM metadata corresponding to an array of mlir LLVM dialect alias scope attributes. | |
| void | setAccessGroupsMetadata (AccessGroupOpInterface op, llvm::Instruction *inst) |
| void | setAliasScopeMetadata (AliasAnalysisOpInterface op, llvm::Instruction *inst) |
| void | setTBAAMetadata (AliasAnalysisOpInterface op, llvm::Instruction *inst) |
| Sets LLVM TBAA metadata for memory operations that have TBAA attributes. | |
| void | setDereferenceableMetadata (DereferenceableOpInterface op, llvm::Instruction *inst) |
| Sets LLVM dereferenceable metadata for operations that have dereferenceable attributes. | |
| void | setBranchWeightsMetadata (WeightedBranchOpInterface op) |
| Sets LLVM profiling metadata for operations that have branch weights. | |
| void | setLoopMetadata (Operation *op, llvm::Instruction *inst) |
| Sets LLVM loop metadata for branch operations that have a loop annotation attribute. | |
| void | setDisjointFlag (Operation *op, llvm::Value *value) |
| Sets the disjoint flag attribute for the exported instruction value given the original operation op. | |
| llvm::Type * | convertType (Type type) |
| Converts the type from MLIR LLVM dialect to LLVM. | |
| MLIRContext & | getContext () |
| Returns the MLIR context of the module being translated. | |
| llvm::LLVMContext & | getLLVMContext () const |
| Returns the LLVM context in which the IR is being constructed. | |
| llvm::GlobalValue * | lookupGlobal (Operation *op) |
| Finds an LLVM IR global value that corresponds to the given MLIR operation defining a global value. | |
| llvm::GlobalValue * | lookupGlobal (StringRef name) const |
| Finds an LLVM IR global value by the mlir.global symbol name. | |
| llvm::GlobalValue * | lookupAlias (Operation *op) |
| Finds an LLVM IR global value that corresponds to the given MLIR operation defining a global alias value. | |
| llvm::GlobalValue * | lookupIFunc (Operation *op) |
| Finds an LLVM IR global value that corresponds to the given MLIR operation defining an IFunc. | |
| llvm::OpenMPIRBuilder * | getOpenMPBuilder () |
| Returns the OpenMP IR builder associated with the LLVM IR module being constructed. | |
| llvm::vfs::FileSystem & | getFileSystem () |
| Returns the virtual filesystem to use for file operations. | |
| llvm::Module * | getLLVMModule () |
| Returns the LLVM module in which the IR is being constructed. | |
| llvm::DILocation * | translateLoc (Location loc, llvm::DILocalScope *scope) |
| Translates the given location. | |
| llvm::DIExpression * | translateExpression (LLVM::DIExpressionAttr attr) |
| Translates the given LLVM DWARF expression metadata. | |
| llvm::DIGlobalVariableExpression * | translateGlobalVariableExpression (LLVM::DIGlobalVariableExpressionAttr attr) |
| Translates the given LLVM global variable expression metadata. | |
| llvm::Metadata * | translateDebugInfo (LLVM::DINodeAttr attr) |
| Translates the given LLVM debug info metadata. | |
| llvm::RoundingMode | translateRoundingMode (LLVM::RoundingMode rounding) |
| Translates the given LLVM rounding mode metadata. | |
| llvm::fp::ExceptionBehavior | translateFPExceptionBehavior (LLVM::FPExceptionBehavior exceptionBehavior) |
| Translates the given LLVM FP exception behavior metadata. | |
| LogicalResult | convertBlock (Block &bb, bool ignoreArguments, llvm::IRBuilderBase &builder) |
| Translates the contents of the given block to LLVM IR using this translator. | |
| LogicalResult | convertOperation (Operation &op, llvm::IRBuilderBase &builder) |
| Converts the given MLIR operation into LLVM IR using this translator. | |
| LogicalResult | convertArgAndResultAttrs (ArgAndResultAttrsOpInterface attrsOp, llvm::CallBase *call, ArrayRef< unsigned > immArgPositions={}) |
| Converts argument and result attributes from attrsOp to LLVM IR attributes on the call instruction. | |
| llvm::NamedMDNode * | getOrInsertNamedModuleMetadata (StringRef name) |
| Gets the named metadata in the LLVM IR module being constructed, creating it if it does not exist. | |
| FailureOr< llvm::Metadata * > | convertMetadataAttr (Attribute attr, function_ref< InFlightDiagnostic()> emitError) |
| Converts an LLVM dialect metadata attribute to LLVM IR metadata. | |
| template<typename T, typename... Args> | |
| void | stackPush (Args &&...args) |
| Creates a stack frame of type T on ModuleTranslation stack. | |
| void | stackPop () |
| Pops the last element from the ModuleTranslation stack. | |
| template<typename T> | |
| WalkResult | stackWalk (llvm::function_ref< WalkResult(T &)> callback) |
| Calls callback for every ModuleTranslation stack frame of type T starting from the top of the stack. | |
| SymbolTableCollection & | symbolTable () |
| template<typename AttrsTy, typename Operation, typename Converter> | |
| void | convertFunctionAttrCollection (AttrsTy attrs, Operation *op, const Converter &conv) |
| A template that takes a collection-like attribute, and converts it via a user provided callback, then adds each element as function attributes to the provided operation. | |
| llvm::Attribute | convertAllocsizeAttr (DenseI32ArrayAttr allocsizeAttr) |
Static Public Member Functions | |
| static std::optional< llvm::Attribute > | convertNoBuiltin (llvm::LLVMContext &ctx, mlir::Attribute a) |
| static std::optional< llvm::Attribute > | convertDefaultFuncAttr (llvm::LLVMContext &ctx, mlir::NamedAttribute namedAttr) |
Friends | |
| std::unique_ptr< llvm::Module > | mlir::translateModuleToLLVMIR (Operation *, llvm::LLVMContext &, StringRef, bool, llvm::vfs::FileSystem *) |
Implementation class for module translation.
Holds a reference to the module being translated, and the mappings between the original and the translated functions, basic blocks and values. It is practically easier to hold these mappings in one class since the conversion of control flow operations needs to look up block and function mappings.
Definition at line 69 of file ModuleTranslation.h.
| using mlir::LLVM::ModuleTranslation::SaveStack = SaveStateStack<T, ModuleTranslation> |
RAII object calling stackPush/stackPop on construction/destruction.
Definition at line 379 of file ModuleTranslation.h.
| llvm::Attribute ModuleTranslation::convertAllocsizeAttr | ( | DenseI32ArrayAttr | allocsizeAttr | ) |
Definition at line 1780 of file ModuleTranslation.cpp.
References getLLVMContext().
Referenced by convertFunctionAttributes(), and convertOperationImpl().
| LogicalResult ModuleTranslation::convertArgAndResultAttrs | ( | ArgAndResultAttrsOpInterface | attrsOp, |
| llvm::CallBase * | call, | ||
| ArrayRef< unsigned > | immArgPositions = {} ) |
Converts argument and result attributes from attrsOp to LLVM IR attributes on the call instruction.
Returns failure if conversion fails. The immArgPositions parameter is only relevant for intrinsics. It specifies the positions of immediate arguments, which do not have associated argument attributes in MLIR and should be skipped during attribute mapping.
Definition at line 1974 of file ModuleTranslation.cpp.
References success().
Referenced by convertCallLLVMIntrinsicOp(), and convertOperationImpl().
|
inline |
Translates the contents of the given block to LLVM IR using this translator.
The LLVM IR basic block corresponding to the given block is expected to exist in the mapping of this translator. Uses builder to translate the IR, leaving it at the end of the block. If ignoreArguments is set, does not produce PHI nodes for the block arguments. Otherwise, the PHI nodes are constructed for block arguments but are not connected to the predecessors that may not exist yet.
Definition at line 322 of file ModuleTranslation.h.
Referenced by convertIteratorRegion(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpOpRegions(), emitUserDefinedMapper(), and inlineConvertOmpRegions().
|
static |
Definition at line 2024 of file ModuleTranslation.cpp.
References mlir::NamedAttribute::getName(), and mlir::NamedAttribute::getValue().
Referenced by convertFunctionAttributes(), and convertOperationImpl().
|
inline |
A template that takes a collection-like attribute, and converts it via a user provided callback, then adds each element as function attributes to the provided operation.
Definition at line 396 of file ModuleTranslation.h.
References getLLVMContext(), and result.
Referenced by convertFunctionAttributes(), and convertOperationImpl().
| FailureOr< llvm::Metadata * > ModuleTranslation::convertMetadataAttr | ( | Attribute | attr, |
| function_ref< InFlightDiagnostic()> | emitError ) |
Converts an LLVM dialect metadata attribute to LLVM IR metadata.
Returns failure and emits a diagnostic using emitError if the attribute cannot be converted.
Definition at line 1585 of file ModuleTranslation.cpp.
References convertMetadataAttr(), mlir::emitError(), getLLVMContext(), lookupAlias(), lookupFunction(), lookupGlobal(), lookupIFunc(), mlir::SymbolTableCollection::lookupSymbolIn(), and symbolTable().
Referenced by convertMetadataAttr(), and convertNamedMetadataOp().
|
static |
Definition at line 2017 of file ModuleTranslation.cpp.
Referenced by convertFunctionAttributes(), and convertOperationImpl().
|
inline |
Converts the given MLIR operation into LLVM IR using this translator.
It is up to the caller to ensure that all operands have been mapped before calling this function.
Definition at line 331 of file ModuleTranslation.h.
Referenced by convertOmpAtomicCompare(), and lookupOrTranslatePureValue().
| llvm::Type * ModuleTranslation::convertType | ( | Type | type | ) |
Converts the type from MLIR LLVM dialect to LLVM.
Definition at line 2480 of file ModuleTranslation.cpp.
Referenced by allocatePrivateVars(), allocReductionVars(), cleanupPrivateVars(), convertAllocateDirOp(), convertCallLLVMIntrinsicOp(), convertFunctionKernelAttributes(), convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpGroupprivate(), convertOmpOpRegions(), convertOmpSimd(), convertOmpTarget(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOperationImpl(), convertParameterAttr(), mlir::LLVM::detail::createIntrinsicCall(), createReductionsAndCleanup(), emitTaskReductionCombFn(), emitTaskReductionInitCall(), emitTaskReductionInitFn(), emitUserDefinedMapper(), findAssociatedValue(), getAllocationSize(), getAllocationSize(), getOverloadedDeclaration(), inlineOmpRegionCleanup(), lookupNonFunctionSymbolCallee(), mapInitializationArgs(), mapParentWithMembers(), and materializeRegionArgValue().
Removes the mapping for blocks contained in the region and values defined in these blocks.
Definition at line 809 of file ModuleTranslation.cpp.
Referenced by convertOmpOpRegions(), copyFirstPrivateVars(), emitTaskReductionCombFn(), emitTaskReductionInitFn(), emitUserDefinedMapper(), fillIteratorLoop(), initPrivateVar(), inlineConvertOmpRegions(), inlineOmpRegionCleanup(), and lookupOrTranslatePureValue().
Removes the mapping for the given value.
Definition at line 211 of file ModuleTranslation.h.
|
inline |
Returns the MLIR context of the module being translated.
Definition at line 256 of file ModuleTranslation.h.
Referenced by convertOperationImpl(), and createVL().
| llvm::vfs::FileSystem & ModuleTranslation::getFileSystem | ( | ) |
Returns the virtual filesystem to use for file operations.
Falls back to the real filesystem if none was provided.
Definition at line 2519 of file ModuleTranslation.cpp.
Referenced by convertDeclareTargetAttr(), convertOmpTarget(), and getRefPtrIfDeclareTarget().
|
inline |
Returns the LLVM context in which the IR is being constructed.
Definition at line 259 of file ModuleTranslation.h.
Referenced by amendOperationImpl(), convertAllocsizeAttr(), convertFunctionAttrCollection(), convertMetadataAttr(), convertOmpCritical(), convertOperationImpl(), getOrCreateAliasScopes(), getXlenType(), setBranchWeightsMetadata(), and setDereferenceableMetadata().
|
inline |
Returns the LLVM module in which the IR is being constructed.
Definition at line 293 of file ModuleTranslation.h.
Referenced by allocatePrivateVars(), buildAffinityData(), convertAllocateDirOp(), convertDeclareTargetAttr(), convertLinkerOptionsOp(), convertModuleFlagsOp(), convertNamedMetadataOp(), convertOmpGroupprivate(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOperationImpl(), convertTargetAllocMemOp(), convertTargetFreeMemOp(), emitTaskReductionCombFn(), emitTaskReductionInitCall(), emitTaskReductionInitFn(), emitTaskReductionModifierFini(), getAllocationSize(), getAllocationSize(), getOrCreateUserDefinedMapperFunc(), and getRefPtrIfDeclareTarget().
| llvm::OpenMPIRBuilder * ModuleTranslation::getOpenMPBuilder | ( | ) |
Returns the OpenMP IR builder associated with the LLVM IR module being constructed.
Definition at line 2493 of file ModuleTranslation.cpp.
Referenced by allocatePrivateVars(), allocReductionVars(), applyFuse(), applyTile(), applyUnrollHeuristic(), applyUnrollPartial(), buildAffinityData(), buildDependData(), cleanupPrivateVars(), convertAllocateDirOp(), convertAllocateFreeOp(), convertAllocSharedMemOp(), convertDeclareTargetAttr(), convertFlagsAttr(), convertFreeSharedMemOp(), convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpCancel(), convertOmpCancellationPoint(), convertOmpCanonicalLoopOp(), convertOmpCritical(), convertOmpDistribute(), convertOmpGroupprivate(), convertOmpInteropDestroyOp(), convertOmpInteropInitOp(), convertOmpInteropUseOp(), convertOmpLoopNest(), convertOmpMasked(), convertOmpMaster(), convertOmpOrdered(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpScope(), convertOmpSections(), convertOmpSimd(), convertOmpSingle(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOmpTaskwaitOp(), convertOmpTeams(), convertOmpThreadprivate(), convertOmpWsloop(), copyFirstPrivateVars(), createAlteredByCaptureMap(), createReductionsAndCleanup(), emitTaskReductionInitCall(), emitTaskReductionModifierFini(), emitUserDefinedMapper(), fillAffinityLocators(), fillIteratorLoop(), genMapInfos(), getOrCreateUserDefinedMapperFunc(), getRefPtrIfDeclareTarget(), handleDeclareTargetMapVar(), and initTargetRuntimeAttrs().
| llvm::MDNode * ModuleTranslation::getOrCreateAliasScope | ( | AliasScopeAttr | aliasScopeAttr | ) |
Returns the LLVM metadata corresponding to a mlir LLVM dialect alias scope attribute.
Creates the metadata node if it has not been converted before.
Definition at line 2230 of file ModuleTranslation.cpp.
References replacement().
Referenced by getOrCreateAliasScopes().
| llvm::MDNode * ModuleTranslation::getOrCreateAliasScopes | ( | ArrayRef< AliasScopeAttr > | aliasScopeAttrs | ) |
Returns the LLVM metadata corresponding to an array of mlir LLVM dialect alias scope attributes.
Creates the metadata nodes if they have not been converted before.
Definition at line 2275 of file ModuleTranslation.cpp.
References getLLVMContext(), and getOrCreateAliasScope().
Referenced by setAliasScopeMetadata().
| llvm::NamedMDNode * ModuleTranslation::getOrInsertNamedModuleMetadata | ( | StringRef | name | ) |
Gets the named metadata in the LLVM IR module being constructed, creating it if it does not exist.
Definition at line 2556 of file ModuleTranslation.cpp.
|
inline |
Mark an OpenMP loop as having been consumed.
Definition at line 133 of file ModuleTranslation.h.
Referenced by applyFuse(), applyTile(), applyUnrollHeuristic(), applyUnrollPartial(), and invalidateOmpLoop().
Mark an OpenMP loop as having been consumed.
Definition at line 136 of file ModuleTranslation.h.
References invalidateOmpLoop().
|
inline |
Finds an LLVM IR global value that corresponds to the given MLIR operation defining a global alias value.
Definition at line 274 of file ModuleTranslation.h.
Referenced by convertMetadataAttr(), convertOperationImpl(), and lookupNonFunctionSymbolCallee().
|
inline |
Finds an LLVM IR basic block that corresponds to the given MLIR block.
Definition at line 116 of file ModuleTranslation.h.
Referenced by mlir::LLVM::detail::connectPHINodes(), convertOmpOpRegions(), and convertOperationImpl().
|
inline |
Finds the LLVM basic block that corresponds to the given BlockAddressAttr.
Definition at line 202 of file ModuleTranslation.h.
Referenced by convertOperationImpl().
|
inline |
Finds an LLVM IR instruction that corresponds to the given MLIR operation with successors.
Definition at line 166 of file ModuleTranslation.h.
Referenced by mlir::LLVM::detail::connectPHINodes(), and setBranchWeightsMetadata().
|
inline |
Finds an LLVM call instruction that corresponds to the given MLIR call operation.
Definition at line 180 of file ModuleTranslation.h.
Referenced by setBranchWeightsMetadata().
|
inline |
Finds an LLVM IR function by its name.
Definition at line 84 of file ModuleTranslation.h.
Referenced by convertDeclareTargetAttr(), convertMetadataAttr(), convertModuleFlagValue(), convertOmpSingle(), convertOmpTarget(), convertOperationImpl(), emitUserDefinedMapper(), and getOrCreateUserDefinedMapperFunc().
|
inline |
Finds an LLVM IR global value that corresponds to the given MLIR operation defining a global value.
Definition at line 263 of file ModuleTranslation.h.
Referenced by convertMetadataAttr(), convertOmpGroupprivate(), convertOmpThreadprivate(), and convertOperationImpl().
|
inline |
Finds an LLVM IR global value by the mlir.global symbol name.
Definition at line 268 of file ModuleTranslation.h.
|
inline |
Finds an LLVM IR global value that corresponds to the given MLIR operation defining an IFunc.
Definition at line 280 of file ModuleTranslation.h.
Referenced by convertMetadataAttr(), convertOperationImpl(), and lookupNonFunctionSymbolCallee().
|
inline |
Find the LLVM-IR loop that represents an MLIR loop.
Definition at line 121 of file ModuleTranslation.h.
References result.
Referenced by applyFuse(), applyTile(), applyUnrollHeuristic(), applyUnrollPartial(), and lookupOMPLoop().
|
inline |
Find the LLVM-IR loop that represents an MLIR loop.
Definition at line 128 of file ModuleTranslation.h.
References lookupOMPLoop().
|
inline |
Finds an LLVM IR value corresponding to the given MLIR value.
Definition at line 101 of file ModuleTranslation.h.
Referenced by applyTile(), buildAffinityData(), buildDependData(), buildDependDataLocator(), calculateBoundsOffset(), mlir::LLVM::detail::connectPHINodes(), convertAllocateDirOp(), convertAllocateFreeOp(), convertFreeSharedMemOp(), convertOmpAtomicCapture(), convertOmpAtomicCompare(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpCancel(), convertOmpCanonicalLoopOp(), convertOmpDistribute(), convertOmpInteropDestroyOp(), convertOmpInteropInitOp(), convertOmpInteropUseOp(), convertOmpLoopNest(), convertOmpMasked(), convertOmpOpRegions(), convertOmpParallel(), convertOmpSections(), convertOmpSimd(), convertOmpSingle(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOmpTeams(), convertOmpWsloop(), convertOperandBundle(), convertOperationImpl(), convertTargetAllocMemOp(), convertTargetFreeMemOp(), fillAffinityLocators(), findAssociatedValue(), getAllocationSize(), getAllocationSize(), getSizeInBytes(), initTargetRuntimeAttrs(), lookupOrTranslatePureValue(), lookupValues(), and mapInitializationArgs().
| SmallVector< llvm::Value * > ModuleTranslation::lookupValues | ( | ValueRange | values | ) |
Looks up remapped a list of remapped values.
A helper to look up remapped operands in the value remapping table.
Definition at line 2485 of file ModuleTranslation.cpp.
References lookupValue().
Referenced by convertCallLLVMIntrinsicOp(), convertOmpOrdered(), convertOperationImpl(), mlir::LLVM::detail::createIntrinsicCall(), and inlineConvertOmpRegions().
Stores the mapping between an MLIR block and LLVM IR basic block.
Definition at line 109 of file ModuleTranslation.h.
References result.
Referenced by convertIteratorRegion(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpOpRegions(), emitUserDefinedMapper(), and inlineConvertOmpRegions().
|
inline |
Maps a BlockAddressAttr to its corresponding LLVM basic block.
Definition at line 194 of file ModuleTranslation.h.
References result.
Referenced by convertOperationImpl().
Stores the mapping between an MLIR operation with successors and a corresponding LLVM IR instruction.
Definition at line 157 of file ModuleTranslation.h.
References result.
Referenced by convertOperationImpl().
Stores a mapping between an MLIR call operation and a corresponding LLVM call instruction.
Definition at line 172 of file ModuleTranslation.h.
References result.
Referenced by convertOperationImpl().
|
inline |
Stores the mapping between a function name and its LLVM IR representation.
Definition at line 76 of file ModuleTranslation.h.
References result.
Referenced by emitUserDefinedMapper(), and getOrCreateUserDefinedMapperFunc().
|
inline |
Map an MLIR OpenMP dialect CanonicalLoopInfo to its lowered LLVM-IR OpenMPIRBuilder CanonicalLoopInfo.
Definition at line 142 of file ModuleTranslation.h.
Referenced by applyFuse(), applyTile(), convertOmpCanonicalLoopOp(), and mapOmpLoop().
|
inline |
Map an MLIR OpenMP dialect CanonicalLoopInfo to its lowered LLVM-IR OpenMPIRBuilder CanonicalLoopInfo.
Definition at line 151 of file ModuleTranslation.h.
References mapOmpLoop().
|
inline |
Maps a blockaddress operation to its corresponding placeholder LLVM value.
Definition at line 186 of file ModuleTranslation.h.
References result.
Referenced by convertOperationImpl().
Stores the mapping between an MLIR value and its LLVM IR counterpart.
Definition at line 89 of file ModuleTranslation.h.
References mapValue().
Referenced by allocReductionVars(), convertAllocSharedMemOp(), convertCallLLVMIntrinsicOp(), convertIteratorRegion(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpCanonicalLoopOp(), convertOmpGroupprivate(), convertOmpLoopNest(), convertOmpSections(), convertOmpTarget(), convertOmpTargetData(), convertOmpTaskgroupOp(), convertOmpTaskloopContextOp(), convertOmpTaskOp(), convertOmpThreadprivate(), convertOperationImpl(), convertTargetAllocMemOp(), copyFirstPrivateVars(), emitTaskReductionCombFn(), emitTaskReductionInitFn(), emitUserDefinedMapper(), initPrivateVar(), initPrivateVars(), inlineOmpRegionCleanup(), lookupOrTranslatePureValue(), makeAtomicReductionGen(), makeReductionGen(), makeRefDataPtrGen(), mapInitializationArgs(), and mapValue().
|
inline |
Provides write-once access to store the LLVM IR value corresponding to the given MLIR value.
Definition at line 93 of file ModuleTranslation.h.
| void ModuleTranslation::setAccessGroupsMetadata | ( | AccessGroupOpInterface | op, |
| llvm::Instruction * | inst ) |
Definition at line 2223 of file ModuleTranslation.cpp.
Referenced by convertOperationImpl().
| void ModuleTranslation::setAliasScopeMetadata | ( | AliasAnalysisOpInterface | op, |
| llvm::Instruction * | inst ) |
Definition at line 2284 of file ModuleTranslation.cpp.
References getOrCreateAliasScopes().
Referenced by convertOperationImpl().
| void ModuleTranslation::setBranchWeightsMetadata | ( | WeightedBranchOpInterface | op | ) |
Sets LLVM profiling metadata for operations that have branch weights.
Definition at line 2340 of file ModuleTranslation.cpp.
References getLLVMContext(), lookupBranch(), and lookupCall().
| void ModuleTranslation::setDereferenceableMetadata | ( | DereferenceableOpInterface | op, |
| llvm::Instruction * | inst ) |
Sets LLVM dereferenceable metadata for operations that have dereferenceable attributes.
Definition at line 2324 of file ModuleTranslation.cpp.
References getLLVMContext().
Sets the disjoint flag attribute for the exported instruction value given the original operation op.
Asserts if the operation does not implement the disjoint flag interface, and asserts if the value is an instruction that implements the disjoint flag.
Definition at line 2473 of file ModuleTranslation.cpp.
Sets LLVM loop metadata for branch operations that have a loop annotation attribute.
Definition at line 2460 of file ModuleTranslation.cpp.
Referenced by convertOperationImpl().
| void ModuleTranslation::setTBAAMetadata | ( | AliasAnalysisOpInterface | op, |
| llvm::Instruction * | inst ) |
Sets LLVM TBAA metadata for memory operations that have TBAA attributes.
Definition at line 2304 of file ModuleTranslation.cpp.
Referenced by convertOperationImpl().
|
inline |
Pops the last element from the ModuleTranslation stack.
Definition at line 368 of file ModuleTranslation.h.
|
inline |
Creates a stack frame of type T on ModuleTranslation stack.
T must be derived from StackFrameBase<T> and constructible from the provided arguments. Doing this before entering the region of the op being translated makes the frame available when translating ops within that region.
Definition at line 363 of file ModuleTranslation.h.
|
inline |
Calls callback for every ModuleTranslation stack frame of type T starting from the top of the stack.
Definition at line 373 of file ModuleTranslation.h.
Referenced by convertOmpLoopNest(), findAllocInsertPoints(), and findCurrentLoopInfo().
|
inline |
Definition at line 381 of file ModuleTranslation.h.
Referenced by convertMetadataAttr(), convertOmpThreadprivate(), convertOperationImpl(), and lookupNonFunctionSymbolCallee().
| llvm::Metadata * ModuleTranslation::translateDebugInfo | ( | LLVM::DINodeAttr | attr | ) |
Translates the given LLVM debug info metadata.
Definition at line 2541 of file ModuleTranslation.cpp.
Referenced by getLocalScopeFromLoc().
| llvm::DIExpression * ModuleTranslation::translateExpression | ( | LLVM::DIExpressionAttr | attr | ) |
Translates the given LLVM DWARF expression metadata.
Definition at line 2531 of file ModuleTranslation.cpp.
| llvm::fp::ExceptionBehavior ModuleTranslation::translateFPExceptionBehavior | ( | LLVM::FPExceptionBehavior | exceptionBehavior | ) |
Translates the given LLVM FP exception behavior metadata.
Definition at line 2550 of file ModuleTranslation.cpp.
| llvm::DIGlobalVariableExpression * ModuleTranslation::translateGlobalVariableExpression | ( | LLVM::DIGlobalVariableExpressionAttr | attr | ) |
Translates the given LLVM global variable expression metadata.
Definition at line 2536 of file ModuleTranslation.cpp.
| llvm::DILocation * ModuleTranslation::translateLoc | ( | Location | loc, |
| llvm::DILocalScope * | scope ) |
Translates the given location.
Definition at line 2525 of file ModuleTranslation.cpp.
| llvm::RoundingMode ModuleTranslation::translateRoundingMode | ( | LLVM::RoundingMode | rounding | ) |
Translates the given LLVM rounding mode metadata.
Definition at line 2546 of file ModuleTranslation.cpp.
|
friend |