LLVM 20.0.0git
Public Member Functions | List of all members
llvm::MatrixBuilder Class Reference

#include "llvm/IR/MatrixBuilder.h"

Public Member Functions

 MatrixBuilder (IRBuilderBase &Builder)
 
CallInstCreateColumnMajorLoad (Type *EltTy, Value *DataPtr, Align Alignment, Value *Stride, bool IsVolatile, unsigned Rows, unsigned Columns, const Twine &Name="")
 Create a column major, strided matrix load.
 
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.
 
CallInstCreateMatrixTranspose (Value *Matrix, unsigned Rows, unsigned Columns, const Twine &Name="")
 Create a llvm.matrix.transpose call, transposing Matrix with Rows rows and Columns columns.
 
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.
 
ValueCreateMatrixInsert (Value *Matrix, Value *NewVal, Value *RowIdx, Value *ColumnIdx, unsigned NumRows)
 Insert a single element NewVal into Matrix at indices (RowIdx, ColumnIdx).
 
ValueCreateAdd (Value *LHS, Value *RHS)
 Add matrixes LHS and RHS.
 
ValueCreateSub (Value *LHS, Value *RHS)
 Subtract matrixes LHS and RHS.
 
ValueCreateScalarMultiply (Value *LHS, Value *RHS)
 Multiply matrix LHS with scalar RHS or scalar LHS with matrix RHS.
 
ValueCreateScalarDiv (Value *LHS, Value *RHS, bool IsUnsigned)
 Divide matrix LHS by scalar RHS.
 
void CreateIndexAssumption (Value *Idx, unsigned NumElements, Twine const &Name="")
 Create an assumption that Idx is less than NumElements.
 
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.
 

Detailed Description

Definition at line 33 of file MatrixBuilder.h.

Constructor & Destructor Documentation

◆ MatrixBuilder()

llvm::MatrixBuilder::MatrixBuilder ( IRBuilderBase Builder)
inline

Definition at line 58 of file MatrixBuilder.h.

Member Function Documentation

◆ CreateAdd()

Value * llvm::MatrixBuilder::CreateAdd ( Value LHS,
Value RHS 
)
inline

Add matrixes LHS and RHS.

Support both integer and floating point matrixes.

Definition at line 157 of file MatrixBuilder.h.

References assert(), LHS, and RHS.

◆ CreateColumnMajorLoad()

CallInst * llvm::MatrixBuilder::CreateColumnMajorLoad ( Type EltTy,
Value DataPtr,
Align  Alignment,
Value Stride,
bool  IsVolatile,
unsigned  Rows,
unsigned  Columns,
const Twine Name = "" 
)
inline

Create a column major, strided matrix load.

EltTy - Matrix element type 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 66 of file MatrixBuilder.h.

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

◆ CreateColumnMajorStore()

CallInst * llvm::MatrixBuilder::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 89 of file MatrixBuilder.h.

References llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), llvm::Value::getType(), llvm::Attribute::getWithAlignment(), Matrix, Name, and Ptr.

◆ CreateIndex()

Value * llvm::MatrixBuilder::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 244 of file MatrixBuilder.h.

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

◆ CreateIndexAssumption()

void llvm::MatrixBuilder::CreateIndexAssumption ( Value Idx,
unsigned  NumElements,
Twine const Name = "" 
)
inline

Create an assumption that Idx is less than NumElements.

Definition at line 231 of file MatrixBuilder.h.

References assert(), and Idx.

◆ CreateMatrixInsert()

Value * llvm::MatrixBuilder::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 146 of file MatrixBuilder.h.

References llvm::Value::getType(), and Matrix.

◆ CreateMatrixMultiply()

CallInst * llvm::MatrixBuilder::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 126 of file MatrixBuilder.h.

References llvm::FixedVectorType::get(), llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), LHS, Name, and RHS.

◆ CreateMatrixTranspose()

CallInst * llvm::MatrixBuilder::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 110 of file MatrixBuilder.h.

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

◆ CreateScalarDiv()

Value * llvm::MatrixBuilder::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 216 of file MatrixBuilder.h.

References assert(), LHS, and RHS.

◆ CreateScalarMultiply()

Value * llvm::MatrixBuilder::CreateScalarMultiply ( Value LHS,
Value RHS 
)
inline

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

Definition at line 207 of file MatrixBuilder.h.

References LHS, and RHS.

◆ CreateSub()

Value * llvm::MatrixBuilder::CreateSub ( Value LHS,
Value RHS 
)
inline

Subtract matrixes LHS and RHS.

Support both integer and floating point matrixes.

Definition at line 182 of file MatrixBuilder.h.

References assert(), LHS, and RHS.


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