LLVM 24.0.0git
LowerMatrixIntrinsics.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Macros

#define DEBUG_TYPE   "lower-matrix-intrinsics"

Functions

 STATISTIC (FlattenedMatrices, "Number of matrix flattenings")
 STATISTIC (ReshapedMatrices, "Number of matrix reshapes")
 STATISTIC (SplitMatrices, "Number of matrix splits")
static DISubprogram * getSubprogram (DIScope *Scope)
 Helper function to either return Scope, if it is a subprogram or the attached subprogram for a local scope.
static bool isSplat (Value *V)
 Return true if V is a splat of a value (which is used when multiplying a matrix with a scalar).
template<typename LTy, typename RTy>
static auto m_AnyMul (const LTy &L, const RTy &R)
 Match any mul operation (fp or integer).
template<typename LTy, typename RTy>
static auto m_AnyAdd (const LTy &L, const RTy &R)
 Match any add operation (fp or integer).
static Value * computeVectorAddr (Value *BasePtr, Value *VecIdx, Value *Stride, unsigned NumElements, Type *EltType, IRBuilder<> &Builder)
static bool isShapePreserving (Value *V)
static iterator_range< Use * > getShapedOperandsForInst (Instruction *I)
 Return an iterator over the operands of I that should share shape information with I.
static std::optional< ShapeInfo > computeShapeInfoForInst (Instruction *I, const DenseMap< Value *, ShapeInfo > &ShapeMap)
 Return the ShapeInfo for the result of I, it it can be determined.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lower-matrix-intrinsics"

Definition at line 59 of file LowerMatrixIntrinsics.cpp.

Function Documentation

◆ computeShapeInfoForInst()

◆ computeVectorAddr()

Value * computeVectorAddr ( Value * BasePtr,
Value * VecIdx,
Value * Stride,
unsigned NumElements,
Type * EltType,
IRBuilder<> & Builder )
static

Definition at line 137 of file LowerMatrixIntrinsics.cpp.

References assert(), llvm::cast(), llvm::isa(), and isZero().

◆ getShapedOperandsForInst()

iterator_range< Use * > getShapedOperandsForInst ( Instruction * I)
static

Return an iterator over the operands of I that should share shape information with I.

Definition at line 272 of file LowerMatrixIntrinsics.cpp.

References AbstractManglingParser< Derived, Alloc >::Ops, assert(), llvm::drop_begin(), I, llvm::isa(), and isShapePreserving().

Referenced by computeShapeInfoForInst().

◆ getSubprogram()

DISubprogram * getSubprogram ( DIScope * Scope)
static

Helper function to either return Scope, if it is a subprogram or the attached subprogram for a local scope.

Definition at line 71 of file LowerMatrixIntrinsics.cpp.

References llvm::cast(), llvm::dyn_cast(), and llvm::DILocalScope::getSubprogram().

◆ isShapePreserving()

bool isShapePreserving ( Value * V)
static

◆ isSplat()

bool isSplat ( Value * V)
static

◆ m_AnyAdd()

template<typename LTy, typename RTy>
auto m_AnyAdd ( const LTy & L,
const RTy & R )
static

Match any add operation (fp or integer).

Definition at line 93 of file LowerMatrixIntrinsics.cpp.

References llvm::PatternMatch::m_Add(), llvm::PatternMatchHelpers::m_CombineOr(), and llvm::PatternMatch::m_FAdd().

◆ m_AnyMul()

template<typename LTy, typename RTy>
auto m_AnyMul ( const LTy & L,
const RTy & R )
static

Match any mul operation (fp or integer).

Definition at line 87 of file LowerMatrixIntrinsics.cpp.

References llvm::PatternMatchHelpers::m_CombineOr(), llvm::PatternMatch::m_FMul(), and llvm::PatternMatch::m_Mul().

◆ STATISTIC() [1/3]

STATISTIC ( FlattenedMatrices ,
"Number of matrix flattenings"  )

◆ STATISTIC() [2/3]

STATISTIC ( ReshapedMatrices ,
"Number of matrix reshapes"  )

◆ STATISTIC() [3/3]

STATISTIC ( SplitMatrices ,
"Number of matrix splits"  )