MLIR 22.0.0git
mlir::NVVM::PtxBuilder Class Reference

A class to build PTX assembly automatically. More...

#include "mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.h"

Public Member Functions

 PtxBuilder (Operation *op, PatternRewriter &rewriter, bool needsManualRegisterMapping=false)
 Single constructor that only initializes members.
LogicalResult insertValue (Value v, PTXRegisterMod itype=PTXRegisterMod::Read)
 Add an operand with the read/write input type.
LLVM::InlineAsmOp build ()
 Builds the inline assembly Op and returns it.
void buildAndReplaceOp ()
 Shortcut to build the inline assembly Op and replace or erase the original op with.

Detailed Description

A class to build PTX assembly automatically.

It is used by BasicPtxBuilderInterface.

Definition at line 62 of file BasicPtxBuilderInterface.h.

Constructor & Destructor Documentation

◆ PtxBuilder()

mlir::NVVM::PtxBuilder::PtxBuilder ( Operation * op,
PatternRewriter & rewriter,
bool needsManualRegisterMapping = false )
inline

Single constructor that only initializes members.

Definition at line 80 of file BasicPtxBuilderInterface.h.

Member Function Documentation

◆ build()

LLVM::InlineAsmOp PtxBuilder::build ( )

Builds the inline assembly Op and returns it.

The insertValue needs to be called to pass operands before building the PTX.

Definition at line 426 of file BasicPtxBuilderInterface.cpp.

References ArrayAttr(), canonicalizeRegisterConstraints(), packResultTypes(), and rewriteAsmPlaceholders().

Referenced by buildAndReplaceOp().

◆ buildAndReplaceOp()

void PtxBuilder::buildAndReplaceOp ( )

Shortcut to build the inline assembly Op and replace or erase the original op with.

Definition at line 467 of file BasicPtxBuilderInterface.cpp.

References build(), extractStructElements(), mlir::detail::IROperandBase::getOwner(), needsPackUnpack(), and mlir::NVVM::ReadWrite.

◆ insertValue()

LogicalResult PtxBuilder::insertValue ( Value v,
PTXRegisterMod itype = PTXRegisterMod::Read )

Add an operand with the read/write input type.

Definition at line 138 of file BasicPtxBuilderInterface.cpp.

References getRegisterType(), mlir::Value::getType(), mlir::NVVM::Read, mlir::NVVM::ReadWrite, success(), and mlir::NVVM::Write.


The documentation for this class was generated from the following files: