MLIR
18.0.0git
|
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
#include "mlir/Dialect/Affine/Analysis/NestedMatcher.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Support/MathExtras.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include <numeric>
#include <optional>
#include <type_traits>
Go to the source code of this file.
Typedefs | |
using | VectorizableOpFun = std::function< bool(AffineForOp, Operation &)> |
Functions | |
static bool | isAccessIndexInvariant (Value iv, Value index) |
Given an induction variable iv of type AffineForOp and an access index of type index, returns true if index is independent of iv and false otherwise. More... | |
template<typename LoadOrStoreOp > | |
static bool | isContiguousAccess (Value iv, LoadOrStoreOp memoryOp, int *memRefDim) |
Given: More... | |
template<typename LoadOrStoreOp > | |
static bool | isVectorElement (LoadOrStoreOp memoryOp) |
static bool | isVectorizableLoopBodyWithOpCond (AffineForOp loop, const VectorizableOpFun &isVectorizableOp, NestedPattern &vectorTransferMatcher) |
using VectorizableOpFun = std::function<bool(AffineForOp, Operation &)> |
Definition at line 268 of file LoopAnalysis.cpp.
Given an induction variable iv
of type AffineForOp and an access index
of type index, returns true
if index
is independent of iv
and false otherwise.
The determination supports composition with at most one AffineApplyOp. The 'at most one AffineApplyOp' comes from the fact that the composition of AffineApplyOp needs to be canonicalized by construction to avoid writing code that composes arbitrary numbers of AffineApplyOps everywhere. To achieve this, at the very least, the compose-affine-apply pass must have been run.
Prerequisites:
iv
and index
of the proper type;Returns false in cases with more than one AffineApplyOp, this is conservative.
Definition at line 163 of file LoopAnalysis.cpp.
References mlir::affine::getReachableAffineApplyOps(), mlir::Value::getType(), and mlir::affine::isAffineForInductionVar().
Referenced by mlir::affine::getInvariantAccesses(), and isContiguousAccess().
|
static |
Given:
iv
of type AffineForOp;memoryOp
of type const LoadOp& or const StoreOp&; determines whether memoryOp
has a contiguous access along iv
. Contiguous is defined as either invariant or varying only along a unique MemRef dim. Upon success, the unique MemRef dim is written in memRefDim
(or -1 to convey the memRef access is invariant along iv
).Prerequisites:
memRefDim
~= nullptr;iv
of the proper type;memoryOp
has no layout map or at most an identity layout map.Currently only supports no layoutMap or identity layoutMap in the MemRef. Returns false if the MemRef has a non-identity layoutMap or more than 1 layoutMap. This is conservative.
Definition at line 218 of file LoopAnalysis.cpp.
References isAccessIndexInvariant().
|
static |
Definition at line 263 of file LoopAnalysis.cpp.
|
static |
Definition at line 271 of file LoopAnalysis.cpp.
References mlir::affine::matcher::If(), and mlir::affine::matcher::Op().
Referenced by mlir::affine::isVectorizableLoopBody().