class MatrixBuilder

Declaration

class MatrixBuilder { /* full declaration omitted */ };

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:33

Member Variables

private llvm::IRBuilderBase& B

Method Overview

  • public llvm::Value * CreateAdd(llvm::Value * LHS, llvm::Value * RHS)
  • public llvm::CallInst * CreateColumnMajorLoad(llvm::Type * EltTy, llvm::Value * DataPtr, llvm::Align Alignment, llvm::Value * Stride, bool IsVolatile, unsigned int Rows, unsigned int Columns, const llvm::Twine & Name = "")
  • public llvm::CallInst * CreateColumnMajorStore(llvm::Value * Matrix, llvm::Value * Ptr, llvm::Align Alignment, llvm::Value * Stride, bool IsVolatile, unsigned int Rows, unsigned int Columns, const llvm::Twine & Name = "")
  • public llvm::Value * CreateIndex(llvm::Value * RowIdx, llvm::Value * ColumnIdx, unsigned int NumRows, const llvm::Twine & Name = "")
  • public void CreateIndexAssumption(llvm::Value * Idx, unsigned int NumElements, const llvm::Twine & Name = "")
  • public llvm::Value * CreateMatrixInsert(llvm::Value * Matrix, llvm::Value * NewVal, llvm::Value * RowIdx, llvm::Value * ColumnIdx, unsigned int NumRows)
  • public llvm::CallInst * CreateMatrixMultiply(llvm::Value * LHS, llvm::Value * RHS, unsigned int LHSRows, unsigned int LHSColumns, unsigned int RHSColumns, const llvm::Twine & Name = "")
  • public llvm::CallInst * CreateMatrixTranspose(llvm::Value * Matrix, unsigned int Rows, unsigned int Columns, const llvm::Twine & Name = "")
  • public llvm::Value * CreateScalarDiv(llvm::Value * LHS, llvm::Value * RHS, bool IsUnsigned)
  • public llvm::Value * CreateScalarMultiply(llvm::Value * LHS, llvm::Value * RHS)
  • public llvm::Value * CreateSub(llvm::Value * LHS, llvm::Value * RHS)
  • public MatrixBuilder(llvm::IRBuilderBase & Builder)
  • private llvm::Module * getModule()
  • private std::pair<Value *, Value *> splatScalarOperandIfNeeded(llvm::Value * LHS, llvm::Value * RHS)

Methods

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

Description

Add matrixes \p LHS and \p RHS. Support both integer and floating point matrixes.

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:157

Parameters

llvm::Value* LHS
llvm::Value* RHS

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

Description

Create a column major, strided matrix load.\p EltTy - Matrix element type\p DataPtr - Start address of the matrix read\p Rows - Number of rows in matrix (must be a constant)\p Columns - Number of columns in matrix (must be a constant)\p Stride - Space between columns

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:66

Parameters

llvm::Type* EltTy
llvm::Value* DataPtr
llvm::Align Alignment
llvm::Value* Stride
bool IsVolatile
unsigned int Rows
unsigned int Columns
const llvm::Twine& Name = ""

llvm::CallInst* CreateColumnMajorStore(
    llvm::Value* Matrix,
    llvm::Value* Ptr,
    llvm::Align Alignment,
    llvm::Value* Stride,
    bool IsVolatile,
    unsigned int Rows,
    unsigned int Columns,
    const llvm::Twine& Name = "")

Description

Create a column major, strided matrix store.\p Matrix - Matrix to store\p Ptr - Pointer to write back to\p Stride - Space between columns

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:89

Parameters

llvm::Value* Matrix
llvm::Value* Ptr
llvm::Align Alignment
llvm::Value* Stride
bool IsVolatile
unsigned int Rows
unsigned int Columns
const llvm::Twine& Name = ""

llvm::Value* CreateIndex(
    llvm::Value* RowIdx,
    llvm::Value* ColumnIdx,
    unsigned int NumRows,
    const llvm::Twine& Name = "")

Description

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

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:244

Parameters

llvm::Value* RowIdx
llvm::Value* ColumnIdx
unsigned int NumRows
const llvm::Twine& Name = ""

void CreateIndexAssumption(
    llvm::Value* Idx,
    unsigned int NumElements,
    const llvm::Twine& Name = "")

Description

Create an assumption that \p Idx is less than \p NumElements.

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:231

Parameters

llvm::Value* Idx
unsigned int NumElements
const llvm::Twine& Name = ""

llvm::Value* CreateMatrixInsert(
    llvm::Value* Matrix,
    llvm::Value* NewVal,
    llvm::Value* RowIdx,
    llvm::Value* ColumnIdx,
    unsigned int NumRows)

Description

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

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:146

Parameters

llvm::Value* Matrix
llvm::Value* NewVal
llvm::Value* RowIdx
llvm::Value* ColumnIdx
unsigned int NumRows

llvm::CallInst* CreateMatrixMultiply(
    llvm::Value* LHS,
    llvm::Value* RHS,
    unsigned int LHSRows,
    unsigned int LHSColumns,
    unsigned int RHSColumns,
    const llvm::Twine& Name = "")

Description

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

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:126

Parameters

llvm::Value* LHS
llvm::Value* RHS
unsigned int LHSRows
unsigned int LHSColumns
unsigned int RHSColumns
const llvm::Twine& Name = ""

llvm::CallInst* CreateMatrixTranspose(
    llvm::Value* Matrix,
    unsigned int Rows,
    unsigned int Columns,
    const llvm::Twine& Name = "")

Description

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

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:110

Parameters

llvm::Value* Matrix
unsigned int Rows
unsigned int Columns
const llvm::Twine& Name = ""

llvm::Value* CreateScalarDiv(llvm::Value* LHS,
                             llvm::Value* RHS,
                             bool IsUnsigned)

Description

Divide matrix \p LHS by scalar \p RHS. If the operands are integers, \p IsUnsigned indicates whether UDiv or SDiv should be used.

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:216

Parameters

llvm::Value* LHS
llvm::Value* RHS
bool IsUnsigned

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

Description

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

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:207

Parameters

llvm::Value* LHS
llvm::Value* RHS

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

Description

Subtract matrixes \p LHS and \p RHS. Support both integer and floating point matrixes.

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:182

Parameters

llvm::Value* LHS
llvm::Value* RHS

MatrixBuilder(llvm::IRBuilderBase& Builder)

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:58

Parameters

llvm::IRBuilderBase& Builder

llvm::Module* getModule()

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:35

std::pair<Value*, Value*>
splatScalarOperandIfNeeded(llvm::Value* LHS,
                           llvm::Value* RHS)

Declared at: llvm/include/llvm/IR/MatrixBuilder.h:37

Parameters

llvm::Value* LHS
llvm::Value* RHS