|
MLIR 23.0.0git
|
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"#include "mlir/Dialect/LLVMIR/LLVMDialect.h"#include "mlir/IR/Operation.h"#include "mlir/Interfaces/CallInterfaces.h"#include "mlir/Support/LLVM.h"#include "mlir/Target/LLVMIR/ModuleTranslation.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/IR/DIBuilder.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InlineAsm.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/MatrixBuilder.h"#include "llvm/IR/MemoryModelRelaxationAnnotations.h"#include "llvm/Support/LogicalResult.h"#include "mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc"#include "mlir/Dialect/LLVMIR/LLVMConversions.inc"#include "mlir/Dialect/LLVMIR/LLVMIntrinsicConversions.inc"Go to the source code of this file.
Functions | |
| static llvm::FastMathFlags | getFastmathFlags (FastmathFlagsInterface &op) |
| static SmallVector< unsigned > | extractPosition (ArrayRef< int64_t > indices) |
| Convert the value of a DenseI64ArrayAttr to a vector of unsigned indices. | |
| static std::string | diagStr (const llvm::Type *type) |
| Convert an LLVM type to a string for printing in diagnostics. | |
| static FailureOr< llvm::Function * > | getOverloadedDeclaration (CallIntrinsicOp op, llvm::Intrinsic::ID id, llvm::Module *module, LLVM::ModuleTranslation &moduleTranslation) |
| Get the declaration of an overloaded llvm intrinsic. | |
| static llvm::OperandBundleDef | convertOperandBundle (OperandRange bundleOperands, StringRef bundleTag, LLVM::ModuleTranslation &moduleTranslation) |
| static SmallVector< llvm::OperandBundleDef > | convertOperandBundles (OperandRangeRange bundleOperands, ArrayAttr bundleTags, LLVM::ModuleTranslation &moduleTranslation) |
| static SmallVector< llvm::OperandBundleDef > | convertOperandBundles (OperandRangeRange bundleOperands, std::optional< ArrayAttr > bundleTags, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertCallLLVMIntrinsicOp (CallIntrinsicOp op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Builder for LLVM_CallIntrinsicOp. | |
| static llvm::Metadata * | convertMetadataAttr (Attribute attr, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| Recursively converts an MLIR metadata attribute to an LLVM metadata node. | |
| static void | convertNamedMetadataOp (StringRef metadataName, ArrayAttr nodes, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static void | convertLinkerOptionsOp (ArrayAttr options, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static llvm::Metadata * | convertModuleFlagValue (StringRef key, ArrayAttr arrayAttr, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static llvm::Metadata * | convertModuleFlagProfileSummaryAttr (StringRef key, ModuleFlagProfileSummaryAttr summaryAttr, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static void | convertModuleFlagsOp (ArrayAttr flags, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static std::pair< llvm::GlobalValue *, llvm::FunctionType * > | lookupNonFunctionSymbolCallee (FlatSymbolRefAttr attr, mlir::Type calleeFuncType, Operation &opInst, LLVM::ModuleTranslation &moduleTranslation) |
| Looks up the GlobalValue and FunctionType for a callee symbol that is not a regular LLVM function (i.e. | |
| static llvm::DILocalScope * | getLocalScopeFromLoc (llvm::IRBuilderBase &builder, Location loc, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | convertOperationImpl (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) |
| static LogicalResult | amendOperationImpl (Operation &op, ArrayRef< llvm::Instruction * > instructions, NamedAttribute attribute, LLVM::ModuleTranslation &moduleTranslation) |
| llvm::Constant * | getLLVMConstant (llvm::Type *llvmType, Attribute attr, Location loc, const ModuleTranslation &moduleTranslation) |
| Create an LLVM IR constant of llvmType from the MLIR attribute attr. | |
|
static |
Definition at line 867 of file LLVMToLLVMIRTranslation.cpp.
References mlir::Operation::emitOpError(), mlir::LLVM::ModuleTranslation::getLLVMContext(), mlir::NamedAttribute::getName(), mlir::NamedAttribute::getValue(), and success().
|
static |
Builder for LLVM_CallIntrinsicOp.
Definition at line 146 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertArgAndResultAttrs(), convertOperandBundles(), mlir::LLVM::ModuleTranslation::convertType(), diagStr(), mlir::emitError(), getFastmathFlags(), getOverloadedDeclaration(), mlir::LLVM::ModuleTranslation::lookupValues(), mlir::LLVM::ModuleTranslation::mapValue(), and success().
|
static |
Definition at line 267 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), mlir::LLVM::ModuleTranslation::getLLVMModule(), and options.
|
static |
Recursively converts an MLIR metadata attribute to an LLVM metadata node.
Definition at line 221 of file LLVMToLLVMIRTranslation.cpp.
References convertMetadataAttr(), and mlir::LLVM::ModuleTranslation::lookupFunction().
Referenced by convertMetadataAttr(), and convertNamedMetadataOp().
|
static |
Definition at line 317 of file LLVMToLLVMIRTranslation.cpp.
Referenced by convertModuleFlagsOp().
|
static |
Definition at line 379 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), convertModuleFlagProfileSummaryAttr(), convertModuleFlagValue(), and mlir::LLVM::ModuleTranslation::getLLVMModule().
|
static |
Definition at line 286 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), and mlir::LLVM::ModuleTranslation::lookupFunction().
Referenced by convertModuleFlagsOp().
|
static |
Definition at line 253 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), convertMetadataAttr(), and mlir::LLVM::ModuleTranslation::getLLVMModule().
|
static |
Definition at line 113 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertOperandBundles().
|
static |
Definition at line 123 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), and convertOperandBundle().
Referenced by convertCallLLVMIntrinsicOp(), convertOperandBundles(), and convertOperationImpl().
|
static |
Definition at line 136 of file LLVMToLLVMIRTranslation.cpp.
References convertOperandBundles().
|
static |
Definition at line 445 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), b, mlir::LLVM::ModuleTranslation::convertAllocsizeAttr(), mlir::LLVM::ModuleTranslation::convertArgAndResultAttrs(), mlir::LLVM::ModuleTranslation::convertDefaultFuncAttr(), mlir::LLVM::ModuleTranslation::convertFunctionAttrCollection(), mlir::LLVM::ModuleTranslation::convertNoBuiltin(), convertOperandBundles(), mlir::LLVM::ModuleTranslation::convertType(), mlir::FlatSymbolRefAttr::get(), mlir::Operation::getAttrOfType(), mlir::LLVM::ModuleTranslation::getContext(), getFastmathFlags(), mlir::LLVM::ModuleTranslation::getLLVMContext(), mlir::LLVM::ModuleTranslation::getLLVMModule(), mlir::Operation::getNumResults(), mlir::Operation::getResult(), mlir::LLVM::ModuleTranslation::lookupAlias(), mlir::LLVM::ModuleTranslation::lookupBlock(), mlir::LLVM::ModuleTranslation::lookupBlockAddress(), mlir::LLVM::ModuleTranslation::lookupFunction(), mlir::LLVM::ModuleTranslation::lookupGlobal(), mlir::LLVM::ModuleTranslation::lookupIFunc(), lookupNonFunctionSymbolCallee(), mlir::LLVM::ModuleTranslation::lookupValue(), mlir::LLVM::ModuleTranslation::lookupValues(), mlir::LLVM::ModuleTranslation::mapBlockAddress(), mlir::LLVM::ModuleTranslation::mapBranch(), mlir::LLVM::ModuleTranslation::mapCall(), mlir::LLVM::ModuleTranslation::mapUnresolvedBlockAddress(), mlir::LLVM::ModuleTranslation::mapValue(), result, mlir::LLVM::ModuleTranslation::setAccessGroupsMetadata(), mlir::LLVM::ModuleTranslation::setAliasScopeMetadata(), mlir::LLVM::ModuleTranslation::setLoopMetadata(), mlir::LLVM::ModuleTranslation::setTBAAMetadata(), success(), and mlir::LLVM::ModuleTranslation::symbolTable().
|
static |
Convert an LLVM type to a string for printing in diagnostics.
Definition at line 67 of file LLVMToLLVMIRTranslation.cpp.
Referenced by convertCallLLVMIntrinsicOp(), and getOverloadedDeclaration().
|
static |
Convert the value of a DenseI64ArrayAttr to a vector of unsigned indices.
Definition at line 60 of file LLVMToLLVMIRTranslation.cpp.
References indices.
|
static |
Definition at line 37 of file LLVMToLLVMIRTranslation.cpp.
Referenced by convertCallLLVMIntrinsicOp(), and convertOperationImpl().
| llvm::Constant * mlir::LLVM::detail::getLLVMConstant | ( | llvm::Type * | llvmType, |
| Attribute | attr, | ||
| Location | loc, | ||
| const ModuleTranslation & | moduleTranslation ) |
Create an LLVM IR constant of llvmType from the MLIR attribute attr.
This currently supports integer, floating point, splat and dense element attributes and combinations thereof. Also, an array attribute with two elements is supported to represent a complex constant. In case of error, report it to loc and return nullptr.
Definition at line 531 of file ModuleTranslation.cpp.
|
static |
Definition at line 434 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LocationAttr::findInstanceOf(), and mlir::LLVM::ModuleTranslation::translateDebugInfo().
|
static |
Get the declaration of an overloaded llvm intrinsic.
First we get the overloaded argument types and/or result type from the CallIntrinsicOp, and then use those to get the correct declaration of the overloaded intrinsic.
Definition at line 78 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), diagStr(), and mlir::emitError().
Referenced by convertCallLLVMIntrinsicOp().
|
static |
Looks up the GlobalValue and FunctionType for a callee symbol that is not a regular LLVM function (i.e.
an alias or ifunc). Returns the lowered GlobalValue and FunctionType derived from calleeFuncType.
Definition at line 417 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), mlir::LLVM::ModuleTranslation::lookupAlias(), mlir::LLVM::ModuleTranslation::lookupIFunc(), mlir::SymbolTableCollection::lookupSymbolIn(), mlir::LLVM::parentLLVMModule(), and mlir::LLVM::ModuleTranslation::symbolTable().
Referenced by convertOperationImpl().