clang 24.0.0git
CIRGenBuiltinNVPTX.cpp File Reference
#include "CIRGenFunction.h"
#include "mlir/IR/Value.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/CIR/Dialect/IR/CIRDialect.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsNVPTX.h"
#include "llvm/Support/NVPTXAddrSpace.h"
#include <algorithm>

Go to the source code of this file.

Classes

struct  NVPTXMmaLdstInfo

Macros

#define MMA_INTR(geom_op_type, layout)
#define MMA_LDST(n, geom_op_type)

Functions

static mlir::Value makeLdu (CIRGenFunction &cgf, const CallExpr *expr, llvm::StringRef intrinsicName)
static mlir::Value makeLdg (CIRGenFunction &cgf, const CallExpr *expr)
static mlir::Value emitUnaryNVVMIntrinsic (CIRGenFunction &cgf, const CallExpr *expr, llvm::StringRef intrinsicName)
 Emit a CIR LLVMIntrinsicCallOp for a unary NVVM intrinsic.
static mlir::Value emitNVVMFPArith (CIRGenFunction &cgf, const CallExpr *expr, llvm::StringRef intrinsicName, llvm::APFloat::roundingMode rm)
 Emit a CIR LLVMIntrinsicCallOp for an NVVM fadd/fmul intrinsic, which takes the rounding mode as a trailing operand.
static mlir::Value emitNVVMFMA (CIRGenFunction &cgf, const CallExpr *expr, llvm::StringRef intrinsicName, llvm::APFloat::roundingMode rm)
 Emit a CIR LLVMIntrinsicCallOp for an NVVM fma intrinsic, which takes the rounding mode as a trailing operand.
static mlir::Value emitBar0Reduction (CIRGenFunction &cgf, const CallExpr *expr, llvm::StringRef intrinsicName, bool returnsPred)
static mlir::Value makeScopedAtomicRMW (CIRGenFunction &cgf, const CallExpr *expr, cir::AtomicFetchKind kind, cir::SyncScopeKind scope)
static mlir::Value makeScopedAtomicXchg (CIRGenFunction &cgf, const CallExpr *expr, cir::SyncScopeKind scope)
static NVPTXMmaLdstInfo getNVPTXMmaLdstInfo (unsigned BuiltinID)
static void storeWMMAFragment (CIRGenBuilderTy &builder, mlir::Location loc, mlir::Value result, Address dst, unsigned numRegisters)
static std::optional< mlir::Value > emitWMMALoad (CIRGenFunction &cgf, const CallExpr *expr, unsigned builtinId)

Macro Definition Documentation

◆ MMA_INTR

#define MMA_INTR ( geom_op_type,
layout )
Value:
llvm::Intrinsic::nvvm_wmma_##geom_op_type##_##layout##_stride

Definition at line 166 of file CIRGenBuiltinNVPTX.cpp.

Referenced by getNVPTXMmaLdstInfo().

◆ MMA_LDST

#define MMA_LDST ( n,
geom_op_type )
Value:
{n, MMA_INTR(geom_op_type, col), MMA_INTR(geom_op_type, row)}
#define MMA_INTR(geom_op_type, layout)

Definition at line 168 of file CIRGenBuiltinNVPTX.cpp.

Referenced by getNVPTXMmaLdstInfo().

Function Documentation

◆ emitBar0Reduction()

◆ emitNVVMFMA()

mlir::Value emitNVVMFMA ( CIRGenFunction & cgf,
const CallExpr * expr,
llvm::StringRef intrinsicName,
llvm::APFloat::roundingMode rm )
static

Emit a CIR LLVMIntrinsicCallOp for an NVVM fma intrinsic, which takes the rounding mode as a trailing operand.

Definition at line 94 of file CIRGenBuiltinNVPTX.cpp.

References clang::CIRGen::CIRGenFunction::emitScalarExpr(), clang::ast_matchers::expr, clang::CIRGen::CIRGenFunction::getBuilder(), and clang::CIRGen::CIRGenFunction::getLoc().

Referenced by clang::CIRGen::CIRGenFunction::emitNVPTXBuiltinExpr().

◆ emitNVVMFPArith()

mlir::Value emitNVVMFPArith ( CIRGenFunction & cgf,
const CallExpr * expr,
llvm::StringRef intrinsicName,
llvm::APFloat::roundingMode rm )
static

Emit a CIR LLVMIntrinsicCallOp for an NVVM fadd/fmul intrinsic, which takes the rounding mode as a trailing operand.

Definition at line 77 of file CIRGenBuiltinNVPTX.cpp.

References clang::CIRGen::CIRGenFunction::emitScalarExpr(), clang::ast_matchers::expr, clang::CIRGen::CIRGenFunction::getBuilder(), and clang::CIRGen::CIRGenFunction::getLoc().

Referenced by clang::CIRGen::CIRGenFunction::emitNVPTXBuiltinExpr().

◆ emitUnaryNVVMIntrinsic()

mlir::Value emitUnaryNVVMIntrinsic ( CIRGenFunction & cgf,
const CallExpr * expr,
llvm::StringRef intrinsicName )
static

Emit a CIR LLVMIntrinsicCallOp for a unary NVVM intrinsic.

The result type is inferred from the single argument.

Definition at line 64 of file CIRGenBuiltinNVPTX.cpp.

References clang::CIRGen::CIRGenFunction::emitScalarExpr(), clang::ast_matchers::expr, clang::CIRGen::CIRGenFunction::getBuilder(), and clang::CIRGen::CIRGenFunction::getLoc().

Referenced by clang::CIRGen::CIRGenFunction::emitNVPTXBuiltinExpr().

◆ emitWMMALoad()

◆ getNVPTXMmaLdstInfo()

NVPTXMmaLdstInfo getNVPTXMmaLdstInfo ( unsigned BuiltinID)
static

◆ makeLdg()

◆ makeLdu()

◆ makeScopedAtomicRMW()

◆ makeScopedAtomicXchg()

◆ storeWMMAFragment()