MLIR  19.0.0git
Macros | Functions
SCFTransformOps.cpp File Reference
#include "mlir/Dialect/SCF/TransformOps/SCFTransformOps.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/LoopUtils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Patterns.h"
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
#include "mlir/Dialect/SCF/Utils/Utils.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
#include "mlir/Dialect/Transform/IR/TransformOps.h"
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/Dialect/SCF/TransformOps/SCFTransformOps.cpp.inc"

Go to the source code of this file.

Macros

#define GET_OP_LIST
 
#define GET_OP_CLASSES
 

Functions

static scf::ExecuteRegionOp wrapInExecuteRegion (RewriterBase &b, Operation *op)
 Wraps the given operation op into an scf.execute_region operation. More...
 
static void loopScheduling (scf::ForOp forOp, std::vector< std::pair< Operation *, unsigned >> &schedule, unsigned iterationInterval, unsigned readLatency)
 Callback for PipeliningOption. More...
 
static void replaceOpWithRegion (RewriterBase &rewriter, Operation *op, Region &region)
 Replaces the given op with the contents of the given single-block region, using the operands of the block terminator to replace operation results. More...
 
static DiagnosedSilenceableFailure isOpSibling (Operation *target, Operation *source)
 Check if target and source are siblings, in the context that target is being fused into source. More...
 
static bool isForallWithIdenticalConfiguration (Operation *target, Operation *source)
 Check if target scf.forall can be fused into source scf.forall. More...
 
static bool isForWithIdenticalConfiguration (Operation *target, Operation *source)
 Check if target scf.for can be fused into source scf.for. More...
 

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 561 of file SCFTransformOps.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

Function Documentation

◆ isForallWithIdenticalConfiguration()

static bool isForallWithIdenticalConfiguration ( Operation target,
Operation source 
)
static

Check if target scf.forall can be fused into source scf.forall.

This simply checks if both loops have the same bounds, steps and mapping. No attempt is made at checking that the side effects of target and source are independent of each other.

Definition at line 467 of file SCFTransformOps.cpp.

◆ isForWithIdenticalConfiguration()

static bool isForWithIdenticalConfiguration ( Operation target,
Operation source 
)
static

Check if target scf.for can be fused into source scf.for.

This simply checks if both loops have the same bounds and steps. No attempt is made at checking that the side effects of target and source are independent of each other.

Definition at line 485 of file SCFTransformOps.cpp.

◆ isOpSibling()

static DiagnosedSilenceableFailure isOpSibling ( Operation target,
Operation source 
)
static

Check if target and source are siblings, in the context that target is being fused into source.

This is a simple check that just checks if both operations are in the same block and some checks to ensure that the fused IR does not violate dominance.

Definition at line 396 of file SCFTransformOps.cpp.

References mlir::emitSilenceableFailure(), mlir::failed(), mlir::Operation::getBlock(), mlir::Operation::getOperands(), mlir::Operation::getRegions(), mlir::Operation::getUsers(), mlir::Operation::isBeforeInBlock(), mlir::DominanceInfo::properlyDominates(), and mlir::visitUsedValuesDefinedAbove().

◆ loopScheduling()

static void loopScheduling ( scf::ForOp  forOp,
std::vector< std::pair< Operation *, unsigned >> &  schedule,
unsigned  iterationInterval,
unsigned  readLatency 
)
static

Callback for PipeliningOption.

Populates schedule with the mapping from an operation to its logical time position given the iteration interval and the read latency. The latter is only relevant for vector transfers.

Definition at line 228 of file SCFTransformOps.cpp.

◆ replaceOpWithRegion()

static void replaceOpWithRegion ( RewriterBase rewriter,
Operation op,
Region region 
)
static

Replaces the given op with the contents of the given single-block region, using the operands of the block terminator to replace operation results.

Definition at line 353 of file SCFTransformOps.cpp.

◆ wrapInExecuteRegion()

static scf::ExecuteRegionOp wrapInExecuteRegion ( RewriterBase b,
Operation op 
)
static

Wraps the given operation op into an scf.execute_region operation.

Uses the provided rewriter for all operations to remain compatible with the rewriting infra, as opposed to just splicing the op in place.

Definition at line 125 of file SCFTransformOps.cpp.