MLIR  20.0.0git
Functions
LLVMToLLVMIRTranslation.cpp File Reference
#include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/Operation.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Target/LLVMIR/ModuleTranslation.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/MatrixBuilder.h"
#include "llvm/IR/Operator.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. More...
 
static std::string diagStr (const llvm::Type *type)
 Convert an LLVM type to a string for printing in diagnostics. More...
 
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. More...
 
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. More...
 
static void convertLinkerOptionsOp (ArrayAttr options, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation)
 
static LogicalResult convertOperationImpl (Operation &opInst, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation)
 

Function Documentation

◆ convertCallLLVMIntrinsicOp()

static LogicalResult convertCallLLVMIntrinsicOp ( CallIntrinsicOp  op,
llvm::IRBuilderBase &  builder,
LLVM::ModuleTranslation moduleTranslation 
)
static

◆ convertLinkerOptionsOp()

static void convertLinkerOptionsOp ( ArrayAttr  options,
llvm::IRBuilderBase &  builder,
LLVM::ModuleTranslation moduleTranslation 
)
static

◆ convertOperandBundle()

static llvm::OperandBundleDef convertOperandBundle ( OperandRange  bundleOperands,
StringRef  bundleTag,
LLVM::ModuleTranslation moduleTranslation 
)
static

◆ convertOperandBundles() [1/2]

static SmallVector<llvm::OperandBundleDef> convertOperandBundles ( OperandRangeRange  bundleOperands,
ArrayAttr  bundleTags,
LLVM::ModuleTranslation moduleTranslation 
)
static

◆ convertOperandBundles() [2/2]

static SmallVector<llvm::OperandBundleDef> convertOperandBundles ( OperandRangeRange  bundleOperands,
std::optional< ArrayAttr >  bundleTags,
LLVM::ModuleTranslation moduleTranslation 
)
static

Definition at line 130 of file LLVMToLLVMIRTranslation.cpp.

References convertOperandBundles().

◆ convertOperationImpl()

static LogicalResult convertOperationImpl ( Operation opInst,
llvm::IRBuilderBase &  builder,
LLVM::ModuleTranslation moduleTranslation 
)
static

◆ diagStr()

static std::string diagStr ( const llvm::Type *  type)
static

Convert an LLVM type to a string for printing in diagnostics.

Definition at line 61 of file LLVMToLLVMIRTranslation.cpp.

Referenced by convertCallLLVMIntrinsicOp(), and getOverloadedDeclaration().

◆ extractPosition()

static SmallVector<unsigned> extractPosition ( ArrayRef< int64_t >  indices)
static

Convert the value of a DenseI64ArrayAttr to a vector of unsigned indices.

Definition at line 54 of file LLVMToLLVMIRTranslation.cpp.

◆ getFastmathFlags()

static llvm::FastMathFlags getFastmathFlags ( FastmathFlagsInterface &  op)
static

Definition at line 31 of file LLVMToLLVMIRTranslation.cpp.

References contract().

Referenced by convertCallLLVMIntrinsicOp(), and convertOperationImpl().

◆ getOverloadedDeclaration()

static FailureOr<llvm::Function *> getOverloadedDeclaration ( CallIntrinsicOp  op,
llvm::Intrinsic::ID  id,
llvm::Module *  module,
LLVM::ModuleTranslation moduleTranslation 
)
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 72 of file LLVMToLLVMIRTranslation.cpp.

References mlir::LLVM::ModuleTranslation::convertType(), diagStr(), mlir::emitError(), mlir::get(), and table.

Referenced by convertCallLLVMIntrinsicOp().