|
LLVM 23.0.0git
|
#include "llvm/IR/MatrixBuilder.h"
Public Member Functions | |
| MatrixBuilder (IRBuilderBase &Builder) | |
| CallInst * | CreateColumnMajorLoad (Type *EltTy, Value *DataPtr, Align Alignment, Value *Stride, bool IsVolatile, unsigned Rows, unsigned Columns, const Twine &Name="") |
| Create a column major, strided matrix load. | |
| CallInst * | CreateColumnMajorStore (Value *Matrix, Value *Ptr, Align Alignment, Value *Stride, bool IsVolatile, unsigned Rows, unsigned Columns, const Twine &Name="") |
| Create a column major, strided matrix store. | |
| CallInst * | CreateMatrixTranspose (Value *Matrix, unsigned Rows, unsigned Columns, const Twine &Name="") |
Create a llvm.matrix.transpose call, transposing Matrix with Rows rows and Columns columns. | |
| CallInst * | CreateMatrixMultiply (Value *LHS, Value *RHS, unsigned LHSRows, unsigned LHSColumns, unsigned RHSColumns, const Twine &Name="") |
Create a llvm.matrix.multiply call, multiplying matrixes LHS and RHS. | |
| CallInst * | CreateRowMajorToColumnMajorTransform (Value *Matrix, unsigned Rows, unsigned Columns, const Twine &Name="") |
| Create a column-major matrix from a row-major matrix with the given logical dimensions by transposing it. | |
| CallInst * | CreateColumnMajorToRowMajorTransform (Value *Matrix, unsigned Rows, unsigned Columns, const Twine &Name="") |
| Create a row-major matrix from a column-major matrix with the given logical dimensions by transposing it. | |
| Value * | CreateMatrixInsert (Value *Matrix, Value *NewVal, Value *RowIdx, Value *ColumnIdx, unsigned NumRows) |
Insert a single element NewVal into Matrix at indices (RowIdx, ColumnIdx). | |
| Value * | CreateAdd (Value *LHS, Value *RHS) |
Add matrixes LHS and RHS. | |
| Value * | CreateSub (Value *LHS, Value *RHS) |
Subtract matrixes LHS and RHS. | |
| Value * | CreateScalarMultiply (Value *LHS, Value *RHS) |
Multiply matrix LHS with scalar RHS or scalar LHS with matrix RHS. | |
| Value * | CreateScalarDiv (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. | |
| Value * | CreateIndex (Value *RowIdx, Value *ColumnIdx, unsigned NumRows, unsigned NumCols, bool IsMatrixRowMajor=false, Twine const &Name="") |
Compute the index to access the element at (RowIdx, ColumnIdx) from a matrix with NumRows or NumCols embedded in a vector depending on matrix major ordering. | |
Definition at line 33 of file MatrixBuilder.h.
|
inline |
Definition at line 58 of file MatrixBuilder.h.
Add matrixes LHS and RHS.
Support both integer and floating point matrixes.
Definition at line 179 of file MatrixBuilder.h.
References assert(), llvm::cast(), llvm::isa(), LHS, and RHS.
|
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 AbstractManglingParser< Derived, Alloc >::Ops, Call, llvm::FixedVectorType::get(), llvm::Function::getFunctionType(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::Value::getType(), and llvm::Attribute::getWithAlignment().
|
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 AbstractManglingParser< Derived, Alloc >::Ops, Call, llvm::Function::getFunctionType(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::Value::getType(), llvm::Attribute::getWithAlignment(), and Matrix.
|
inline |
Create a row-major matrix from a column-major matrix with the given logical dimensions by transposing it.
Assumes the matrix transpose assumes column-major matrix memory layout, which is true in the case of the DirectX and SPIRV backends, but not necessarily true in the case of the LowerMatrixIntrinsics pass.
Definition at line 160 of file MatrixBuilder.h.
References CreateMatrixTranspose(), and Matrix.
|
inline |
Compute the index to access the element at (RowIdx, ColumnIdx) from a matrix with NumRows or NumCols embedded in a vector depending on matrix major ordering.
Definition at line 266 of file MatrixBuilder.h.
References llvm::IntegerType::get(), llvm::Type::getContext(), llvm::Type::getScalarSizeInBits(), and llvm::Value::getType().
|
inline |
Create an assumption that Idx is less than NumElements.
Definition at line 253 of file MatrixBuilder.h.
References assert(), llvm::cast(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), and llvm::isa().
|
inline |
Insert a single element NewVal into Matrix at indices (RowIdx, ColumnIdx).
Definition at line 168 of file MatrixBuilder.h.
References llvm::Value::getType(), and Matrix.
|
inline |
Create a llvm.matrix.multiply call, multiplying matrixes LHS and RHS.
Definition at line 126 of file MatrixBuilder.h.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::cast(), llvm::FixedVectorType::get(), llvm::Function::getFunctionType(), llvm::Intrinsic::getOrInsertDeclaration(), LHS, and RHS.
|
inline |
Create a llvm.matrix.transpose call, transposing Matrix with Rows rows and Columns columns.
Definition at line 110 of file MatrixBuilder.h.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::cast(), llvm::FixedVectorType::get(), llvm::Function::getFunctionType(), llvm::Intrinsic::getOrInsertDeclaration(), and Matrix.
Referenced by CreateColumnMajorToRowMajorTransform(), and CreateRowMajorToColumnMajorTransform().
|
inline |
Create a column-major matrix from a row-major matrix with the given logical dimensions by transposing it.
Assumes the matrix transpose assumes column-major matrix memory layout, which is true in the case of the DirectX and SPIRV backends, but not necessarily true in the case of the LowerMatrixIntrinsics pass.
Definition at line 149 of file MatrixBuilder.h.
References CreateMatrixTranspose(), and Matrix.
Divide matrix LHS by scalar RHS.
If the operands are integers, IsUnsigned indicates whether UDiv or SDiv should be used.
Definition at line 238 of file MatrixBuilder.h.
References assert(), llvm::cast(), llvm::isa(), LHS, and RHS.
Multiply matrix LHS with scalar RHS or scalar LHS with matrix RHS.
Definition at line 229 of file MatrixBuilder.h.
Subtract matrixes LHS and RHS.
Support both integer and floating point matrixes.
Definition at line 204 of file MatrixBuilder.h.
References assert(), llvm::cast(), llvm::isa(), LHS, and RHS.