MLIR  20.0.0git
Macros | Functions
DecomposeAffineOps.cpp File Reference
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/Transforms/Transforms.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/Support/Debug.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "decompose-affine-ops"
 
#define DBGS()   (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
 
#define DBGSNL()   (llvm::dbgs() << "\n")
 

Functions

static int64_t numEnclosingInvariantLoops (OpOperand &operand)
 Count the number of loops surrounding operand such that operand could be hoisted above. More...
 
static AffineApplyOp createSubApply (RewriterBase &rewriter, AffineApplyOp originalOp, AffineExpr expr)
 Build an affine.apply that is a subexpression expr of originalOps affine map and with the same operands. More...
 

Macro Definition Documentation

◆ DBGS

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

Definition at line 24 of file DecomposeAffineOps.cpp.

◆ DBGSNL

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

Definition at line 25 of file DecomposeAffineOps.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "decompose-affine-ops"

Definition at line 23 of file DecomposeAffineOps.cpp.

Function Documentation

◆ createSubApply()

static AffineApplyOp createSubApply ( RewriterBase rewriter,
AffineApplyOp  originalOp,
AffineExpr  expr 
)
static

Build an affine.apply that is a subexpression expr of originalOps affine map and with the same operands.

Canonicalize the map and operands to deduplicate and drop dead operands before returning but do not perform maximal composition of AffineApplyOp which would defeat the purpose.

Definition at line 85 of file DecomposeAffineOps.cpp.

◆ numEnclosingInvariantLoops()

static int64_t numEnclosingInvariantLoops ( OpOperand operand)
static

Count the number of loops surrounding operand such that operand could be hoisted above.

Stop counting at the first loop over which the operand cannot be hoisted.

Definition at line 30 of file DecomposeAffineOps.cpp.

References mlir::IROperand< DerivedT, IRValueT >::get(), mlir::detail::IROperandBase::getOwner(), and mlir::Operation::getParentOfType().