MLIR  20.0.0git
Macros | Functions
Utils.cpp File Reference
#include "mlir/Dialect/Transform/IR/Utils.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
#include "mlir/IR/Verifier.h"
#include "mlir/Interfaces/FunctionInterfaces.h"
#include "llvm/Support/Debug.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "transform-dialect-utils"
 
#define DBGS()   (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
 

Functions

static bool canMergeInto (FunctionOpInterface func1, FunctionOpInterface func2)
 Return whether func1 can be merged into func2. More...
 
static InFlightDiagnostic mergeInto (FunctionOpInterface func1, FunctionOpInterface func2)
 Merge func1 into func2. More...
 

Macro Definition Documentation

◆ DBGS

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

Definition at line 18 of file Utils.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "transform-dialect-utils"

Definition at line 17 of file Utils.cpp.

Function Documentation

◆ canMergeInto()

static bool canMergeInto ( FunctionOpInterface  func1,
FunctionOpInterface  func2 
)
static

Return whether func1 can be merged into func2.

For that to work func1 has to be a declaration (aka has to be external) and func2 either has to be a declaration as well, or it has to be public (otherwise, it wouldn't be visible by func1).

Definition at line 24 of file Utils.cpp.

Referenced by mergeInto().

◆ mergeInto()

static InFlightDiagnostic mergeInto ( FunctionOpInterface  func1,
FunctionOpInterface  func2 
)
static

Merge func1 into func2.

The two ops must be inside the same parent op and mergable according to canMergeInto. The function erases func1 such that only func2 exists when the function returns.

Definition at line 31 of file Utils.cpp.

References canMergeInto(), mlir::get(), and mlir::MLIRContext::getLoadedDialect().