MLIR  16.0.0git
Namespaces | Macros | Functions
PipelineDataTransfer.cpp File Reference
#include "mlir/Dialect/Affine/Passes.h"
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.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/Affine/Utils.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/Builders.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/Debug.h"
#include "mlir/Dialect/Affine/Passes.h.inc"
+ Include dependency graph for PipelineDataTransfer.cpp:

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 

Macros

#define GEN_PASS_DEF_AFFINEPIPELINEDATATRANSFER
 
#define DEBUG_TYPE   "affine-pipeline-data-transfer"
 

Functions

static unsigned getTagMemRefPos (Operation &dmaOp)
 
static bool doubleBuffer (Value oldMemRef, AffineForOp forOp)
 Doubles the buffer of the supplied memref on the specified 'affine.for' operation by adding a leading dimension of size two to the memref. More...
 
static bool checkTagMatch (AffineDmaStartOp startOp, AffineDmaWaitOp waitOp)
 
static void findMatchingStartFinishInsts (AffineForOp forOp, SmallVectorImpl< std::pair< Operation *, Operation * >> &startWaitPairs)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "affine-pipeline-data-transfer"

Definition at line 34 of file PipelineDataTransfer.cpp.

◆ GEN_PASS_DEF_AFFINEPIPELINEDATATRANSFER

#define GEN_PASS_DEF_AFFINEPIPELINEDATATRANSFER

Definition at line 30 of file PipelineDataTransfer.cpp.

Function Documentation

◆ checkTagMatch()

static bool checkTagMatch ( AffineDmaStartOp  startOp,
AffineDmaWaitOp  waitOp 
)
static

◆ doubleBuffer()

static bool doubleBuffer ( Value  oldMemRef,
AffineForOp  forOp 
)
static

Doubles the buffer of the supplied memref on the specified 'affine.for' operation by adding a leading dimension of size two to the memref.

Replaces all uses of the old memref by the new one while indexing the newly added dimension by the loop IV of the specified 'affine.for' operation modulo 2. Returns false if such a replacement cannot be performed.

Definition at line 73 of file PipelineDataTransfer.cpp.

References mlir::Type::cast(), copy(), mlir::OpBuilder::create(), mlir::OpBuilder::createOrFold(), mlir::detail::enumerate(), mlir::failed(), mlir::AffineMap::get(), mlir::Builder::getAffineDimExpr(), mlir::Value::getType(), mlir::replaceAllMemRefUsesWith(), mlir::OpBuilder::setInsertionPointAfter(), and mlir::MemRefType::Builder::setShape().

◆ findMatchingStartFinishInsts()

static void findMatchingStartFinishInsts ( AffineForOp  forOp,
SmallVectorImpl< std::pair< Operation *, Operation * >> &  startWaitPairs 
)
static

Definition at line 170 of file PipelineDataTransfer.cpp.

References checkTagMatch().

◆ getTagMemRefPos()

static unsigned getTagMemRefPos ( Operation dmaOp)
static

Definition at line 59 of file PipelineDataTransfer.cpp.