|
MLIR 23.0.0git
|
#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/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/ADT/TypeSwitch.h"#include "llvm/Support/Debug.h"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 LogicalResult | replaceUsesAndPropagateType (RewriterBase &rewriter, Operation *oldOp, Value val) |
| Replace the uses of oldOp with the given val and for view-like uses propagate the type change. | |
| #define DBGS | ( | ) |
| #define DBGSNL | ( | ) |
Definition at line 31 of file MultiBuffer.cpp.
| #define DEBUG_TYPE "memref-transforms" |
Definition at line 29 of file MultiBuffer.cpp.
Return true if the op fully overwrite the given buffer value.
Definition at line 34 of file MultiBuffer.cpp.
Referenced by mlir::memref::multiBuffer().
|
static |
Replace the uses of oldOp with the given val and for view-like uses propagate the type change.
Changing the memref type may require propagating it through view-like ops (subview, expand_shape, collapse_shape, cast) so we need to propagate the type change and erase old view ops.
Only view-like ops whose result type can be recomputed from the new source type and existing op attributes are handled here. Other ops fall back to operand replacement without type propagation.
Definition at line 49 of file MultiBuffer.cpp.
References mlir::Operation::emitOpError(), mlir::RewriterBase::eraseOp(), mlir::RewriterBase::finalizeOpModification(), mlir::Builder::getType(), mlir::Value::getType(), mlir::Operation::getUses(), replacement(), replaceUsesAndPropagateType(), mlir::OpBuilder::setInsertionPoint(), mlir::RewriterBase::startOpModification(), and success().
Referenced by mlir::memref::multiBuffer(), and replaceUsesAndPropagateType().