MLIR 22.0.0git
MultiBuffer.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "memref-transforms"
#define DBGS()
#define DBGSNL()

Functions

static bool overrideBuffer (Operation *op, Value buffer)
 Return true if the op fully overwrite the given buffer value.
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.

Macro Definition Documentation

◆ DBGS

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

Definition at line 29 of file MultiBuffer.cpp.

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

◆ DBGSNL

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

Definition at line 30 of file MultiBuffer.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "memref-transforms"

Definition at line 28 of file MultiBuffer.cpp.

Function Documentation

◆ overrideBuffer()

bool overrideBuffer ( Operation * op,
Value buffer )
static

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

Definition at line 33 of file MultiBuffer.cpp.

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

◆ replaceUsesAndPropagateType()

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 44 of file MultiBuffer.cpp.

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

Referenced by mlir::memref::multiBuffer(), and replaceUsesAndPropagateType().