MLIR
17.0.0git
|
#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/LoopFusionUtils.h"
#include "mlir/Dialect/Affine/LoopUtils.h"
#include "mlir/Dialect/Affine/Utils.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Builders.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <iomanip>
#include <optional>
#include <sstream>
#include "mlir/Dialect/Affine/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
mlir | |
Include the generated interface declarations. | |
Macros | |
#define | GEN_PASS_DEF_AFFINELOOPFUSION |
#define | DEBUG_TYPE "affine-loop-fusion" |
Functions | |
static void | sinkSequentialLoops (MemRefDependenceGraph::Node *node) |
static unsigned | getMemRefEltSizeInBytes (MemRefType memRefType) |
static Value | createPrivateMemRef (AffineForOp forOp, Operation *srcStoreOpInst, unsigned dstLoopDepth, std::optional< unsigned > fastMemorySpace, uint64_t localBufSizeThreshold) |
static bool | hasNonAffineUsersOnThePath (unsigned srcId, unsigned dstId, Value memref, MemRefDependenceGraph *mdg) |
Walking from node 'srcId' to node 'dstId' (exclusive of 'srcId' and 'dstId'), if there is any non-affine operation accessing 'memref', return true. More... | |
static bool | hasNonAffineUsersOnThePath (unsigned srcId, unsigned dstId, MemRefDependenceGraph *mdg) |
Check whether a memref value in node 'srcId' has a non-affine that is between node 'srcId' and node 'dstId' (exclusive of 'srcNode' and 'dstNode'). More... | |
static bool | isFusionProfitable (Operation *srcOpInst, Operation *srcStoreOpInst, AffineForOp dstForOp, ArrayRef< ComputationSliceState > depthSliceUnions, unsigned maxLegalFusionDepth, unsigned *dstLoopDepth, double computeToleranceThreshold) |
#define DEBUG_TYPE "affine-loop-fusion" |
Definition at line 43 of file LoopFusion.cpp.
#define GEN_PASS_DEF_AFFINELOOPFUSION |
Definition at line 39 of file LoopFusion.cpp.
|
static |
Definition at line 926 of file LoopFusion.cpp.
References mlir::MemRefRegion::compute(), mlir::OpBuilder::create(), mlir::floorDiv(), mlir::AffineMap::get(), mlir::Builder::getAffineConstantExpr(), mlir::Builder::getAffineDimExpr(), mlir::MemRefRegion::getConstantBoundingSizeAndShape(), mlir::MemRefRegion::getConstraints(), mlir::Operation::getLoc(), getMemRefEltSizeInBytes(), mlir::presburger::IntegerRelation::getNumCols(), mlir::presburger::IntegerRelation::getNumVars(), mlir::Operation::getParentRegion(), mlir::FlatAffineValueConstraints::getValues(), mlir::replaceAllMemRefUsesWith(), mlir::simplifyAffineExpr(), and mlir::succeeded().
|
static |
Definition at line 907 of file LoopFusion.cpp.
Referenced by createPrivateMemRef().
|
static |
Check whether a memref value in node 'srcId' has a non-affine that is between node 'srcId' and node 'dstId' (exclusive of 'srcNode' and 'dstNode').
Definition at line 1062 of file LoopFusion.cpp.
References mlir::WalkResult::advance(), mlir::Operation::getOperands(), and hasNonAffineUsersOnThePath().
|
static |
Walking from node 'srcId' to node 'dstId' (exclusive of 'srcId' and 'dstId'), if there is any non-affine operation accessing 'memref', return true.
Otherwise, return false.
Definition at line 1028 of file LoopFusion.cpp.
References mlir::WalkResult::advance(), mlir::Value::getUsers(), mlir::WalkResult::interrupt(), mlir::Operation::isBeforeInBlock(), and mlir::Operation::walk().
Referenced by hasNonAffineUsersOnThePath().
|
static |
Definition at line 1122 of file LoopFusion.cpp.
References mlir::MemRefRegion::compute(), mlir::failed(), mlir::getAffineForIVs(), mlir::getComputeCost(), mlir::getFusionComputeCost(), mlir::Operation::getLoc(), mlir::getLoopNestStats(), mlir::getMemoryFootprintBytes(), mlir::MemRefRegion::getRegionSize(), mlir::ComputationSliceState::isEmpty(), and max().
|
static |
Definition at line 900 of file LoopFusion.cpp.
References mlir::sinkSequentialLoops().