MLIR  20.0.0git
Namespaces | Macros | Functions | Variables
AsyncToLLVM.cpp File Reference
#include "mlir/Conversion/AsyncToLLVM/AsyncToLLVM.h"
#include "mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h"
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Async/IR/Async.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
#include "mlir/Dialect/LLVMIR/FunctionCallUtils.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
#include "mlir/Conversion/Passes.h.inc"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 

Macros

#define GEN_PASS_DEF_CONVERTASYNCTOLLVMPASS
 
#define DEBUG_TYPE   "convert-async-to-llvm"
 

Functions

static void addAsyncRuntimeApiDeclarations (ModuleOp module)
 Adds Async Runtime C API declarations to the module. More...
 
static void addResumeFunction (ModuleOp module)
 A function that takes a coroutine handle and calls a llvm.coro.resume intrinsics. More...
 

Variables

static constexpr const char * kAddRef = "mlirAsyncRuntimeAddRef"
 
static constexpr const char * kDropRef = "mlirAsyncRuntimeDropRef"
 
static constexpr const char * kCreateToken = "mlirAsyncRuntimeCreateToken"
 
static constexpr const char * kCreateValue = "mlirAsyncRuntimeCreateValue"
 
static constexpr const char * kCreateGroup = "mlirAsyncRuntimeCreateGroup"
 
static constexpr const char * kEmplaceToken = "mlirAsyncRuntimeEmplaceToken"
 
static constexpr const char * kEmplaceValue = "mlirAsyncRuntimeEmplaceValue"
 
static constexpr const char * kSetTokenError = "mlirAsyncRuntimeSetTokenError"
 
static constexpr const char * kSetValueError = "mlirAsyncRuntimeSetValueError"
 
static constexpr const char * kIsTokenError = "mlirAsyncRuntimeIsTokenError"
 
static constexpr const char * kIsValueError = "mlirAsyncRuntimeIsValueError"
 
static constexpr const char * kIsGroupError = "mlirAsyncRuntimeIsGroupError"
 
static constexpr const char * kAwaitToken = "mlirAsyncRuntimeAwaitToken"
 
static constexpr const char * kAwaitValue = "mlirAsyncRuntimeAwaitValue"
 
static constexpr const char * kAwaitGroup = "mlirAsyncRuntimeAwaitAllInGroup"
 
static constexpr const char * kExecute = "mlirAsyncRuntimeExecute"
 
static constexpr const char * kGetValueStorage
 
static constexpr const char * kAddTokenToGroup
 
static constexpr const char * kAwaitTokenAndExecute
 
static constexpr const char * kAwaitValueAndExecute
 
static constexpr const char * kAwaitAllAndExecute
 
static constexpr const char * kGetNumWorkerThreads
 
static constexpr const char * kResume = "__resume"
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "convert-async-to-llvm"

Definition at line 33 of file AsyncToLLVM.cpp.

◆ GEN_PASS_DEF_CONVERTASYNCTOLLVMPASS

#define GEN_PASS_DEF_CONVERTASYNCTOLLVMPASS

Definition at line 29 of file AsyncToLLVM.cpp.

Function Documentation

◆ addAsyncRuntimeApiDeclarations()

static void addAsyncRuntimeApiDeclarations ( ModuleOp  module)
static

◆ addResumeFunction()

static void addResumeFunction ( ModuleOp  module)
static

A function that takes a coroutine handle and calls a llvm.coro.resume intrinsics.

We need this function to be able to pass it to the async runtime execute API.

Definition at line 247 of file AsyncToLLVM.cpp.

References mlir::ImplicitLocOpBuilder::atBlockEnd(), mlir::get(), and kResume.

Variable Documentation

◆ kAddRef

constexpr const char* kAddRef = "mlirAsyncRuntimeAddRef"
staticconstexpr

Definition at line 42 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAddTokenToGroup

constexpr const char* kAddTokenToGroup
staticconstexpr
Initial value:
=
"mlirAsyncRuntimeAddTokenToGroup"

Definition at line 60 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAwaitAllAndExecute

constexpr const char* kAwaitAllAndExecute
staticconstexpr
Initial value:
=
"mlirAsyncRuntimeAwaitAllInGroupAndExecute"

Definition at line 66 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAwaitGroup

constexpr const char* kAwaitGroup = "mlirAsyncRuntimeAwaitAllInGroup"
staticconstexpr

Definition at line 56 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAwaitToken

constexpr const char* kAwaitToken = "mlirAsyncRuntimeAwaitToken"
staticconstexpr

Definition at line 54 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAwaitTokenAndExecute

constexpr const char* kAwaitTokenAndExecute
staticconstexpr
Initial value:
=
"mlirAsyncRuntimeAwaitTokenAndExecute"

Definition at line 62 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAwaitValue

constexpr const char* kAwaitValue = "mlirAsyncRuntimeAwaitValue"
staticconstexpr

Definition at line 55 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kAwaitValueAndExecute

constexpr const char* kAwaitValueAndExecute
staticconstexpr
Initial value:
=
"mlirAsyncRuntimeAwaitValueAndExecute"

Definition at line 64 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kCreateGroup

constexpr const char* kCreateGroup = "mlirAsyncRuntimeCreateGroup"
staticconstexpr

Definition at line 46 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kCreateToken

constexpr const char* kCreateToken = "mlirAsyncRuntimeCreateToken"
staticconstexpr

Definition at line 44 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kCreateValue

constexpr const char* kCreateValue = "mlirAsyncRuntimeCreateValue"
staticconstexpr

Definition at line 45 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kDropRef

constexpr const char* kDropRef = "mlirAsyncRuntimeDropRef"
staticconstexpr

Definition at line 43 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kEmplaceToken

constexpr const char* kEmplaceToken = "mlirAsyncRuntimeEmplaceToken"
staticconstexpr

Definition at line 47 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kEmplaceValue

constexpr const char* kEmplaceValue = "mlirAsyncRuntimeEmplaceValue"
staticconstexpr

Definition at line 48 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kExecute

constexpr const char* kExecute = "mlirAsyncRuntimeExecute"
staticconstexpr

Definition at line 57 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kGetNumWorkerThreads

constexpr const char* kGetNumWorkerThreads
staticconstexpr
Initial value:
=
"mlirAsyncRuntimGetNumWorkerThreads"

Definition at line 68 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kGetValueStorage

constexpr const char* kGetValueStorage
staticconstexpr
Initial value:
=
"mlirAsyncRuntimeGetValueStorage"

Definition at line 58 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kIsGroupError

constexpr const char* kIsGroupError = "mlirAsyncRuntimeIsGroupError"
staticconstexpr

Definition at line 53 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kIsTokenError

constexpr const char* kIsTokenError = "mlirAsyncRuntimeIsTokenError"
staticconstexpr

Definition at line 51 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kIsValueError

constexpr const char* kIsValueError = "mlirAsyncRuntimeIsValueError"
staticconstexpr

Definition at line 52 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kResume

constexpr const char* kResume = "__resume"
staticconstexpr

Definition at line 242 of file AsyncToLLVM.cpp.

Referenced by addResumeFunction().

◆ kSetTokenError

constexpr const char* kSetTokenError = "mlirAsyncRuntimeSetTokenError"
staticconstexpr

Definition at line 49 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().

◆ kSetValueError

constexpr const char* kSetValueError = "mlirAsyncRuntimeSetValueError"
staticconstexpr

Definition at line 50 of file AsyncToLLVM.cpp.

Referenced by addAsyncRuntimeApiDeclarations().