MLIR  20.0.0git
Macros | Functions
MultiBuffer.cpp File Reference
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
#include "mlir/Dialect/MemRef/Transforms/Transforms.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/ValueRange.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Debug.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "memref-transforms"
 
#define DBGS()   (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
 
#define DBGSNL()   (llvm::dbgs() << "\n")
 

Functions

static bool overrideBuffer (Operation *op, Value buffer)
 Return true if the op fully overwrite the given buffer value. More...
 
static void replaceUsesAndPropagateType (RewriterBase &rewriter, Operation *oldOp, Value val)
 Replace the uses of oldOp with the given val and for subview uses propagate the type change. More...
 

Macro Definition Documentation

◆ DBGS

#define DBGS ( )    (llvm::dbgs() << "[" DEBUG_TYPE "]: ")

Definition at line 30 of file MultiBuffer.cpp.

◆ DBGSNL

#define DBGSNL ( )    (llvm::dbgs() << "\n")

Definition at line 31 of file MultiBuffer.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "memref-transforms"

Definition at line 29 of file MultiBuffer.cpp.

Function Documentation

◆ overrideBuffer()

static bool overrideBuffer ( Operation op,
Value  buffer 
)
static

Return true if the op fully overwrite the given buffer value.

Definition at line 34 of file MultiBuffer.cpp.

Referenced by mlir::memref::multiBuffer().

◆ replaceUsesAndPropagateType()

static void replaceUsesAndPropagateType ( RewriterBase rewriter,
Operation oldOp,
Value  val 
)
static

Replace the uses of oldOp with the given val and for subview uses propagate the type change.

Changing the memref type may require propagating it through subview ops so we cannot just do a replaceAllUse but need to propagate the type change and erase old subview ops.

Definition at line 45 of file MultiBuffer.cpp.

References mlir::OpBuilder::create(), mlir::RewriterBase::eraseOp(), mlir::RewriterBase::finalizeOpModification(), mlir::Value::getType(), mlir::Operation::getUses(), mlir::OpBuilder::setInsertionPoint(), and mlir::RewriterBase::startOpModification().

Referenced by mlir::memref::multiBuffer().