LLVM  14.0.0git
Public Member Functions | List of all members
llvm::MatrixBuilder< IRBuilderTy > Class Template Reference

#include "llvm/IR/MatrixBuilder.h"

Public Member Functions

 MatrixBuilder (IRBuilderTy &Builder)
 
CallInstCreateColumnMajorLoad (Value *DataPtr, Align Alignment, Value *Stride, bool IsVolatile, unsigned Rows, unsigned Columns, const Twine &Name="")
 Create a column major, strided matrix load. More...
 
CallInstCreateColumnMajorStore (Value *Matrix, Value *Ptr, Align Alignment, Value *Stride, bool IsVolatile, unsigned Rows, unsigned Columns, const Twine &Name="")
 Create a column major, strided matrix store. More...
 
CallInstCreateMatrixTranspose (Value *Matrix, unsigned Rows, unsigned Columns, const Twine &Name="")
 Create a llvm.matrix.transpose call, transposing Matrix with Rows rows and Columns columns. More...
 
CallInstCreateMatrixMultiply (Value *LHS, Value *RHS, unsigned LHSRows, unsigned LHSColumns, unsigned RHSColumns, const Twine &Name="")
 Create a llvm.matrix.multiply call, multiplying matrixes LHS and RHS. More...
 
ValueCreateMatrixInsert (Value *Matrix, Value *NewVal, Value *RowIdx, Value *ColumnIdx, unsigned NumRows)
 Insert a single element NewVal into Matrix at indices (RowIdx, ColumnIdx). More...
 
ValueCreateAdd (Value *LHS, Value *RHS)
 Add matrixes LHS and RHS. More...
 
ValueCreateSub (Value *LHS, Value *RHS)
 Subtract matrixes LHS and RHS. More...
 
ValueCreateScalarMultiply (Value *LHS, Value *RHS)
 Multiply matrix LHS with scalar RHS or scalar LHS with matrix RHS. More...
 
ValueCreateScalarDiv (Value *LHS, Value *RHS, bool IsUnsigned)
 Divide matrix LHS by scalar RHS. More...
 
void CreateIndexAssumption (Value *Idx, unsigned NumElements, Twine const &Name="")
 Create an assumption that Idx is less than NumElements. More...
 
ValueCreateIndex (Value *RowIdx, Value *ColumnIdx, unsigned NumRows, Twine const &Name="")
 Compute the index to access the element at (RowIdx, ColumnIdx) from a matrix with NumRows embedded in a vector. More...
 

Detailed Description

template<class IRBuilderTy>
class llvm::MatrixBuilder< IRBuilderTy >

Definition at line 33 of file MatrixBuilder.h.

Constructor & Destructor Documentation

◆ MatrixBuilder()

template<class IRBuilderTy >
llvm::MatrixBuilder< IRBuilderTy >::MatrixBuilder ( IRBuilderTy &  Builder)
inline

Definition at line 58 of file MatrixBuilder.h.

References B.

Member Function Documentation

◆ CreateAdd()

template<class IRBuilderTy >
Value* llvm::MatrixBuilder< IRBuilderTy >::CreateAdd ( Value LHS,
Value RHS 
)
inline

Add matrixes LHS and RHS.

Support both integer and floating point matrixes.

Definition at line 161 of file MatrixBuilder.h.

References assert(), B, llvm::Value::getType(), and llvm::Type::isVectorTy().

◆ CreateColumnMajorLoad()

template<class IRBuilderTy >
CallInst* llvm::MatrixBuilder< IRBuilderTy >::CreateColumnMajorLoad ( Value DataPtr,
Align  Alignment,
Value Stride,
bool  IsVolatile,
unsigned  Rows,
unsigned  Columns,
const Twine Name = "" 
)
inline

Create a column major, strided matrix load.

DataPtr - Start address of the matrix read Rows - Number of rows in matrix (must be a constant) Columns - Number of columns in matrix (must be a constant) Stride - Space between columns

Definition at line 65 of file MatrixBuilder.h.

References B, llvm::FixedVectorType::get(), llvm::Intrinsic::getDeclaration(), llvm::PointerType::getElementType(), llvm::Function::getFunctionType(), llvm::Value::getType(), llvm::Attribute::getWithAlignment(), and llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile.

◆ CreateColumnMajorStore()

template<class IRBuilderTy >
CallInst* llvm::MatrixBuilder< IRBuilderTy >::CreateColumnMajorStore ( Value Matrix,
Value Ptr,
Align  Alignment,
Value Stride,
bool  IsVolatile,
unsigned  Rows,
unsigned  Columns,
const Twine Name = "" 
)
inline

Create a column major, strided matrix store.

Matrix - Matrix to store Ptr - Pointer to write back to Stride - Space between columns

Definition at line 93 of file MatrixBuilder.h.

References B, llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), llvm::Value::getType(), llvm::Attribute::getWithAlignment(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile, and Matrix.

◆ CreateIndex()

template<class IRBuilderTy >
Value* llvm::MatrixBuilder< IRBuilderTy >::CreateIndex ( Value RowIdx,
Value ColumnIdx,
unsigned  NumRows,
Twine const Name = "" 
)
inline

Compute the index to access the element at (RowIdx, ColumnIdx) from a matrix with NumRows embedded in a vector.

Definition at line 249 of file MatrixBuilder.h.

References B, llvm::IntegerType::get(), llvm::Type::getContext(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), and llvm::max().

◆ CreateIndexAssumption()

template<class IRBuilderTy >
void llvm::MatrixBuilder< IRBuilderTy >::CreateIndexAssumption ( Value Idx,
unsigned  NumElements,
Twine const Name = "" 
)
inline

Create an assumption that Idx is less than NumElements.

Definition at line 235 of file MatrixBuilder.h.

References assert(), B, llvm::Type::getScalarSizeInBits(), and llvm::Value::getType().

◆ CreateMatrixInsert()

template<class IRBuilderTy >
Value* llvm::MatrixBuilder< IRBuilderTy >::CreateMatrixInsert ( Value Matrix,
Value NewVal,
Value RowIdx,
Value ColumnIdx,
unsigned  NumRows 
)
inline

Insert a single element NewVal into Matrix at indices (RowIdx, ColumnIdx).

Definition at line 150 of file MatrixBuilder.h.

References B, llvm::ConstantInt::get(), llvm::Value::getType(), and Matrix.

◆ CreateMatrixMultiply()

template<class IRBuilderTy >
CallInst* llvm::MatrixBuilder< IRBuilderTy >::CreateMatrixMultiply ( Value LHS,
Value RHS,
unsigned  LHSRows,
unsigned  LHSColumns,
unsigned  RHSColumns,
const Twine Name = "" 
)
inline

Create a llvm.matrix.multiply call, multiplying matrixes LHS and RHS.

Definition at line 130 of file MatrixBuilder.h.

References B, llvm::FixedVectorType::get(), llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), and llvm::Value::getType().

◆ CreateMatrixTranspose()

template<class IRBuilderTy >
CallInst* llvm::MatrixBuilder< IRBuilderTy >::CreateMatrixTranspose ( Value Matrix,
unsigned  Rows,
unsigned  Columns,
const Twine Name = "" 
)
inline

Create a llvm.matrix.transpose call, transposing Matrix with Rows rows and Columns columns.

Definition at line 114 of file MatrixBuilder.h.

References B, llvm::FixedVectorType::get(), llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), and Matrix.

◆ CreateScalarDiv()

template<class IRBuilderTy >
Value* llvm::MatrixBuilder< IRBuilderTy >::CreateScalarDiv ( Value LHS,
Value RHS,
bool  IsUnsigned 
)
inline

Divide matrix LHS by scalar RHS.

If the operands are integers, IsUnsigned indicates whether UDiv or SDiv should be used.

Definition at line 220 of file MatrixBuilder.h.

References assert(), B, llvm::Value::getType(), and llvm::Type::isVectorTy().

◆ CreateScalarMultiply()

template<class IRBuilderTy >
Value* llvm::MatrixBuilder< IRBuilderTy >::CreateScalarMultiply ( Value LHS,
Value RHS 
)
inline

Multiply matrix LHS with scalar RHS or scalar LHS with matrix RHS.

Definition at line 211 of file MatrixBuilder.h.

References B, llvm::Type::getScalarType(), llvm::Value::getType(), and llvm::Type::isFloatingPointTy().

◆ CreateSub()

template<class IRBuilderTy >
Value* llvm::MatrixBuilder< IRBuilderTy >::CreateSub ( Value LHS,
Value RHS 
)
inline

Subtract matrixes LHS and RHS.

Support both integer and floating point matrixes.

Definition at line 186 of file MatrixBuilder.h.

References assert(), B, llvm::Value::getType(), and llvm::Type::isVectorTy().


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