MLIR
16.0.0git
|
#include "mlir/Dialect/Affine/LoopFusionUtils.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/LoopAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/LoopUtils.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Operation.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "loop-fusion-utils" |
Functions | |
static void | getLoadAndStoreMemRefAccesses (Operation *opA, DenseMap< Value, bool > &values) |
static bool | isDependentLoadOrStoreOp (Operation *op, DenseMap< Value, bool > &values) |
Returns true if 'op' is a load or store operation which access a memref accessed 'values' and at least one of the access is a store operation. More... | |
static Operation * | getFirstDependentOpInRange (Operation *opA, Operation *opB) |
static Operation * | getLastDependentOpInRange (Operation *opA, Operation *opB) |
static Operation * | getFusedLoopNestInsertionPoint (AffineForOp srcForOp, AffineForOp dstForOp) |
static bool | gatherLoadsAndStores (AffineForOp forOp, SmallVectorImpl< Operation *> &loadAndStoreOps) |
static unsigned | getMaxLoopDepth (ArrayRef< Operation *> srcOps, ArrayRef< Operation *> dstOps) |
Returns the maximum loop depth at which we could fuse producer loop 'srcForOp' into consumer loop 'dstForOp' without violating data dependences. More... | |
LogicalResult | promoteSingleIterReductionLoop (AffineForOp forOp, bool siblingFusionUser) |
Patch the loop body of a forOp that is a single iteration reduction loop into its containing block. More... | |
static int64_t | getComputeCostHelper (Operation *forOp, LoopNestStats &stats, llvm::SmallDenseMap< Operation *, uint64_t, 8 > *tripCountOverrideMap, DenseMap< Operation *, int64_t > *computeCostMap) |
#define DEBUG_TYPE "loop-fusion-utils" |
Definition at line 33 of file LoopFusionUtils.cpp.
|
static |
Definition at line 179 of file LoopFusionUtils.cpp.
Referenced by mlir::canFuseLoops().
|
static |
Definition at line 533 of file LoopFusionUtils.cpp.
References mlir::LoopNestStats::loopMap, mlir::LoopNestStats::opCountMap, and mlir::LoopNestStats::tripCountMap.
Referenced by mlir::getComputeCost(), and mlir::getFusionComputeCost().
Definition at line 67 of file LoopFusionUtils.cpp.
References getLoadAndStoreMemRefAccesses(), isDependentLoadOrStoreOp(), and mlir::Operation::walk().
Referenced by getFusedLoopNestInsertionPoint().
|
static |
Definition at line 138 of file LoopFusionUtils.cpp.
References getFirstDependentOpInRange(), getLastDependentOpInRange(), and mlir::Operation::isBeforeInBlock().
Referenced by mlir::canFuseLoops(), and mlir::createLoopFusionPass().
Definition at line 93 of file LoopFusionUtils.cpp.
References mlir::WalkResult::advance(), getLoadAndStoreMemRefAccesses(), mlir::getLoopIVs(), mlir::Operation::getResults(), mlir::WalkResult::interrupt(), isDependentLoadOrStoreOp(), value, and mlir::Operation::walk().
Referenced by getFusedLoopNestInsertionPoint().
|
static |
Definition at line 39 of file LoopFusionUtils.cpp.
References mlir::Operation::walk().
Referenced by getFirstDependentOpInRange(), and getLastDependentOpInRange().
|
static |
Returns the maximum loop depth at which we could fuse producer loop 'srcForOp' into consumer loop 'dstForOp' without violating data dependences.
Definition at line 195 of file LoopFusionUtils.cpp.
References mlir::checkMemrefAccessDependence(), mlir::gatherProducerConsumerMemrefs(), mlir::getInnermostCommonLoopDepth(), mlir::getNumCommonSurroundingLoops(), mlir::hasDependence(), and min().
Referenced by mlir::canFuseLoops().
Returns true if 'op' is a load or store operation which access a memref accessed 'values' and at least one of the access is a store operation.
Returns false otherwise.
Definition at line 54 of file LoopFusionUtils.cpp.
Referenced by getFirstDependentOpInRange(), and getLastDependentOpInRange().
LogicalResult promoteSingleIterReductionLoop | ( | AffineForOp | forOp, |
bool | siblingFusionUser | ||
) |
Patch the loop body of a forOp that is a single iteration reduction loop into its containing block.
Definition at line 369 of file LoopFusionUtils.cpp.
References mlir::failure(), mlir::getConstantTripCount(), mlir::getForwardSlice(), mlir::replaceForOpWithNewYields(), mlir::success(), and mlir::topologicalSort().
Referenced by mlir::fuseLoops().