|
LLVM 24.0.0git
|
#include "llvm/Transforms/Scalar/LowerMatrixIntrinsics.h"#include "ScalarOptions.h"#include "llvm/ADT/PostOrderIterator.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/ScopeExit.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/DomTreeUpdater.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/OptimizationRemarkEmitter.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/Analysis/VectorUtils.h"#include "llvm/IR/CFG.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/MatrixBuilder.h"#include "llvm/IR/PatternMatch.h"#include "llvm/IR/ProfDataUtils.h"#include "llvm/Support/Alignment.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/LoopUtils.h"#include "llvm/Transforms/Utils/MatrixUtils.h"#include <cmath>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. | |
| #define DEBUG_TYPE "lower-matrix-intrinsics" |
Definition at line 59 of file LowerMatrixIntrinsics.cpp.
|
static |
Return the ShapeInfo for the result of I, it it can be determined.
Definition at line 282 of file LowerMatrixIntrinsics.cpp.
References llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::find(), getShapedOperandsForInst(), I, isShapePreserving(), llvm::PatternMatch::m_Intrinsic(), llvm::PatternMatch::m_Store(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and N.
|
static |
Definition at line 137 of file LowerMatrixIntrinsics.cpp.
References assert(), llvm::cast(), llvm::isa(), and isZero().
|
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().
|
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().
Definition at line 212 of file LowerMatrixIntrinsics.cpp.
References llvm::dyn_cast(), I, II, llvm::isa(), and llvm_unreachable.
Referenced by computeShapeInfoForInst(), and getShapedOperandsForInst().
Return true if V is a splat of a value (which is used when multiplying a matrix with a scalar).
Definition at line 79 of file LowerMatrixIntrinsics.cpp.
References llvm::dyn_cast().
Referenced by llvm::PPC::get_VSPLTI_elt(), slpvectorizer::BoUpSLP::isTreeNotExtendable(), slpvectorizer::BoUpSLP::isTreeTinyAndNotFullyVectorizable(), slpvectorizer::BoUpSLP::processBuildVector(), and llvm::InstCombinerImpl::visitShuffleVectorInst().
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().
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 | ( | FlattenedMatrices | , |
| "Number of matrix flattenings" | ) |
| STATISTIC | ( | ReshapedMatrices | , |
| "Number of matrix reshapes" | ) |
| STATISTIC | ( | SplitMatrices | , |
| "Number of matrix splits" | ) |
References llvm::ProfcheckDisableMetadataFixes.