|
MLIR 22.0.0git
|
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.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 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 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 729 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 145 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 218 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), mlir::LLVM::ModuleTranslation::getLLVMModule(), and options.
|
static |
Definition at line 268 of file LLVMToLLVMIRTranslation.cpp.
Referenced by convertModuleFlagsOp().
|
static |
Definition at line 330 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), convertModuleFlagProfileSummaryAttr(), convertModuleFlagValue(), and mlir::LLVM::ModuleTranslation::getLLVMModule().
|
static |
Definition at line 237 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), and mlir::LLVM::ModuleTranslation::lookupFunction().
Referenced by convertModuleFlagsOp().
|
static |
Definition at line 112 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::lookupValue().
Referenced by convertOperandBundles().
|
static |
Definition at line 122 of file LLVMToLLVMIRTranslation.cpp.
References ArrayAttr(), and convertOperandBundle().
Referenced by convertCallLLVMIntrinsicOp(), convertOperandBundles(), and convertOperationImpl().
|
static |
Definition at line 135 of file LLVMToLLVMIRTranslation.cpp.
References convertOperandBundles().
|
static |
Definition at line 376 of file LLVMToLLVMIRTranslation.cpp.
References b, mlir::LLVM::ModuleTranslation::convertArgAndResultAttrs(), 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(), mlir::SymbolTableCollection::lookupSymbolIn(), 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(), mlir::LLVM::parentLLVMModule(), 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 66 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 59 of file LLVMToLLVMIRTranslation.cpp.
References indices.
|
static |
Definition at line 36 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 505 of file ModuleTranslation.cpp.
|
static |
Definition at line 365 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 77 of file LLVMToLLVMIRTranslation.cpp.
References mlir::LLVM::ModuleTranslation::convertType(), diagStr(), and mlir::emitError().
Referenced by convertCallLLVMIntrinsicOp().