MLIR  22.0.0git
Namespaces | Macros | Functions
ReifyResultShapes.cpp File Reference
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Transforms/Transforms.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "llvm/Support/InterleavedRange.h"
#include "mlir/Dialect/MemRef/Transforms/Passes.h.inc"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::memref
 

Macros

#define DEBUG_TYPE   "reify-result-shapes"
 
#define DBGS()   (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
 
#define GEN_PASS_DEF_REIFYRESULTSHAPESPASS
 

Functions

static LogicalResult reifyOpResultShapes (RewriterBase &rewriter, ReifyRankedShapedTypeOpInterface op)
 Reifies the results of op, potentially replacing op with a reified version. More...
 

Macro Definition Documentation

◆ DBGS

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

Definition at line 24 of file ReifyResultShapes.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "reify-result-shapes"

Definition at line 23 of file ReifyResultShapes.cpp.

◆ GEN_PASS_DEF_REIFYRESULTSHAPESPASS

#define GEN_PASS_DEF_REIFYRESULTSHAPESPASS

Definition at line 28 of file ReifyResultShapes.cpp.

Function Documentation

◆ reifyOpResultShapes()

static LogicalResult reifyOpResultShapes ( RewriterBase rewriter,
ReifyRankedShapedTypeOpInterface  op 
)
static

Reifies the results of op, potentially replacing op with a reified version.

Returns failure if mlir::reifyResultShapes returned failure, otherwise it always succeeds. Users of this transform should always expect it to modify the IR, even when it fails. If any of the result types changes, the transform will insert cast operations to the old type to keep the IR consistent.

Definition at line 41 of file ReifyResultShapes.cpp.

References mlir::OpBuilder::clone(), DBGS, mlir::remark::failed(), mlir::getConstantIntValue(), mlir::Operation::getResult(), mlir::reifyResultShapes(), mlir::RewriterBase::replaceOp(), and mlir::Value::setType().