MLIR  22.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 "llvm/Support/Debug.h"
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/InterleavedRange.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "decompose-affine-ops"
 

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

◆ DEBUG_TYPE

#define DEBUG_TYPE   "decompose-affine-ops"

Definition at line 24 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 84 of file DecomposeAffineOps.cpp.

References mlir::affine::canonicalizeMapAndOperands(), mlir::AffineMap::get(), mlir::AffineMap::getNumDims(), and mlir::AffineMap::getNumSymbols().

Referenced by mlir::affine::decompose().

◆ 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 29 of file DecomposeAffineOps.cpp.

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