MLIR 24.0.0git
NVVMMBarrierOps.cpp File Reference
#include "mlir/Dialect/LLVMIR/NVVMMBarrierOps.h"
#include "IR/NVVMOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Types.h"
#include "mlir/Target/LLVMIR/ModuleTranslation.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicsNVPTX.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/FormatVariadic.h"
#include <optional>
#include <string>
#include <utility>
#include "mlir/Dialect/LLVMIR/NVVMMBarrierOps.cpp.inc"

Go to the source code of this file.

Macros

#define GET_OP_CLASSES

Functions

static bool isPtrInGenericSpace (mlir::Value ptr)
static bool isPtrInSharedClusterSpace (mlir::Value ptr)
static llvm::Value * castPtrToAddrSpace (llvm::IRBuilderBase &builder, llvm::Value *ptr, NVVMMemorySpace targetAS)
static LogicalResult verifyMBarrierArriveLikeOp (Operation *op, Value addr, NVVM::MemScopeKind scope, Value retVal=nullptr, Value multicastMask=nullptr)
static LogicalResult inferMBarrierArriveResultTypes (MLIRContext *context, Value addr, SmallVectorImpl< Type > &inferredReturnTypes)
 Only shared_cluster (ptr<7>) produces zero results; all other address spaces (including generic) return i64.
static bool isCompatibleReturnTypesOptionalResult (TypeRange inferred, TypeRange actual)
 For ops with optional results, allow the user to omit the result even when inference would produce one.
static void appendMBarrierMulticastArgs (Value multicastMask, LLVM::ModuleTranslation &mt, llvm::IRBuilderBase &builder, SmallVectorImpl< llvm::Value * > &args)

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 678 of file NVVMMBarrierOps.cpp.

Function Documentation

◆ appendMBarrierMulticastArgs()

void appendMBarrierMulticastArgs ( Value multicastMask,
LLVM::ModuleTranslation & mt,
llvm::IRBuilderBase & builder,
SmallVectorImpl< llvm::Value * > & args )
static

Definition at line 297 of file NVVMMBarrierOps.cpp.

References mlir::LLVM::ModuleTranslation::lookupValue().

◆ castPtrToAddrSpace()

llvm::Value * castPtrToAddrSpace ( llvm::IRBuilderBase & builder,
llvm::Value * ptr,
NVVMMemorySpace targetAS )
static

Definition at line 47 of file NVVMMBarrierOps.cpp.

◆ inferMBarrierArriveResultTypes()

LogicalResult inferMBarrierArriveResultTypes ( MLIRContext * context,
Value addr,
SmallVectorImpl< Type > & inferredReturnTypes )
static

Only shared_cluster (ptr<7>) produces zero results; all other address spaces (including generic) return i64.

Definition at line 123 of file NVVMMBarrierOps.cpp.

References isPtrInSharedClusterSpace(), and success().

◆ isCompatibleReturnTypesOptionalResult()

bool isCompatibleReturnTypesOptionalResult ( TypeRange inferred,
TypeRange actual )
static

For ops with optional results, allow the user to omit the result even when inference would produce one.

This preserves backward compatibility: the result can be silently discarded (e.g., for fire-and-forget arrive ops).

Definition at line 170 of file NVVMMBarrierOps.cpp.

◆ isPtrInGenericSpace()

bool isPtrInGenericSpace ( mlir::Value ptr)
static

Definition at line 39 of file NVVMMBarrierOps.cpp.

References mlir::NVVM::isPtrInAddrSpace().

◆ isPtrInSharedClusterSpace()

bool isPtrInSharedClusterSpace ( mlir::Value ptr)
static

◆ verifyMBarrierArriveLikeOp()

LogicalResult verifyMBarrierArriveLikeOp ( Operation * op,
Value addr,
NVVM::MemScopeKind scope,
Value retVal = nullptr,
Value multicastMask = nullptr )
static