MLIR 24.0.0git
SCF.cpp File Reference
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Conversion/ConvertToEmitC/ToEmitCInterface.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.h"
#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/DeviceMappingInterface.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/FunctionInterfaces.h"
#include "mlir/Interfaces/ParallelCombiningOpInterface.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
#include "mlir/Transforms/InliningUtils.h"
#include "mlir/Transforms/RegionUtils.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/DebugLog.h"
#include <optional>
#include "mlir/Dialect/SCF/IR/SCFOpsDialect.cpp.inc"
#include "mlir/Dialect/SCF/IR/SCFOps.cpp.inc"

Go to the source code of this file.

Classes

struct  MultiBlockExecuteInliner

Macros

#define GET_OP_LIST
#define GET_OP_CLASSES

Functions

template<typename TerminatorTy>
static TerminatorTy verifyAndGetTerminator (Operation *op, Region &region, StringRef errorMessage)
 Verifies that the first block of the given region is terminated by a TerminatorTy.
static void printInitializationList (OpAsmPrinter &p, Block::BlockArgListType blocksArgs, ValueRange initializers, StringRef prefix="")
 Prints the initialization list in the form of <prefix>(inner = outer, inner2 = outer2, <...>) where 'inner' values are assumed to be region arguments and 'outer' values are regular SSA values.
static ParseResult parseSwitchCases (OpAsmParser &p, DenseI64ArrayAttr &cases, SmallVectorImpl< std::unique_ptr< Region > > &caseRegions)
 Parse the case regions and values.
static void printSwitchCases (OpAsmPrinter &p, Operation *op, DenseI64ArrayAttr cases, RegionRange caseRegions)
 Print the case regions and values.

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 3885 of file SCF.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

Function Documentation

◆ parseSwitchCases()

ParseResult parseSwitchCases ( OpAsmParser & p,
DenseI64ArrayAttr & cases,
SmallVectorImpl< std::unique_ptr< Region > > & caseRegions )
static

◆ printInitializationList()

void printInitializationList ( OpAsmPrinter & p,
Block::BlockArgListType blocksArgs,
ValueRange initializers,
StringRef prefix = "" )
static

Prints the initialization list in the form of <prefix>(inner = outer, inner2 = outer2, <...>) where 'inner' values are assumed to be region arguments and 'outer' values are regular SSA values.

Definition at line 502 of file SCF.cpp.

◆ printSwitchCases()

void printSwitchCases ( OpAsmPrinter & p,
Operation * op,
DenseI64ArrayAttr cases,
RegionRange caseRegions )
static

Print the case regions and values.

Definition at line 3750 of file SCF.cpp.

References mlir::detail::DenseArrayAttrImpl< T >::asArrayRef(), mlir::AsmPrinter::printNewline(), and mlir::OpAsmPrinter::printRegion().

◆ verifyAndGetTerminator()

template<typename TerminatorTy>
TerminatorTy verifyAndGetTerminator ( Operation * op,
Region & region,
StringRef errorMessage )
static

Verifies that the first block of the given region is terminated by a TerminatorTy.

Reports errors on the given operation if it is not the case.

Definition at line 102 of file SCF.cpp.

References mlir::Block::back(), diag(), mlir::Operation::emitOpError(), mlir::Block::empty(), mlir::Region::empty(), mlir::Region::front(), and mlir::Operation::getLoc().