MLIR
20.0.0git
|
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/CastInterfaces.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.cpp.inc"
#include "mlir/Dialect/Transform/Interfaces/TransformTypeInterfaces.cpp.inc"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "transform-dialect" |
#define | DEBUG_TYPE_FULL "transform-dialect-full" |
#define | DEBUG_PRINT_AFTER_ALL "transform-dialect-print-top-level-after-all" |
#define | DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "] ") |
#define | LDBG(X) LLVM_DEBUG(DBGS() << (X)) |
#define | FULL_LDBG(X) DEBUG_WITH_TYPE(DEBUG_TYPE_FULL, (DBGS() << (X))) |
Functions | |
static bool | happensBefore (Operation *a, Operation *b) |
Return true if a happens before b , i.e., a or one of its ancestors properly dominates b and b is not inside a . More... | |
static DiagnosedSilenceableFailure | dispatchMappedValues (Value handle, ArrayRef< transform::MappedValue > values, function_ref< LogicalResult(ArrayRef< Operation * >)> operationsFn, function_ref< LogicalResult(ArrayRef< transform::Param >)> paramsFn, function_ref< LogicalResult(ValueRange)> valuesFn) |
Given a list of MappedValues, cast them to the value kind implied by the interface of the handle type, and dispatch to one of the callbacks. More... | |
template<typename Mapping , typename Key , typename Mapped > | |
void | dropMappingEntry (Mapping &mapping, Key key, Mapped mapped) |
template<typename T > | |
DiagnosedSilenceableFailure | checkRepeatedConsumptionInOperand (ArrayRef< T > payload, transform::TransformOpInterface transform, unsigned operandNumber) |
template<typename T > | |
static SmallVector< T > | castVector (ArrayRef< transform::MappedValue > range) |
static void | remapEffects (MemoryEffectOpInterface iface, BlockArgument source, OpOperand *target, SmallVectorImpl< MemoryEffects::EffectInstance > &effects) |
Appends to effects the memory effect instances on target with the same resource and effect as the ones the operation iface having on source . More... | |
static void | remapArgumentEffects (Block &block, MutableArrayRef< OpOperand > operands, SmallVectorImpl< MemoryEffects::EffectInstance > &effects) |
Appends to effects the same effects as the operations of block have on block arguments but associated with operands. More... | |
template<typename EffectTy , typename ResourceTy , typename Range > | |
static bool | hasEffect (Range &&effects) |
Returns true if the given list of effects instances contains an instance with the effect type specified as template parameter. More... | |
#define DBGS | ( | ) | (llvm::dbgs() << "[" DEBUG_TYPE "] ") |
Definition at line 24 of file TransformInterfaces.cpp.
#define DEBUG_PRINT_AFTER_ALL "transform-dialect-print-top-level-after-all" |
Definition at line 23 of file TransformInterfaces.cpp.
#define DEBUG_TYPE "transform-dialect" |
Definition at line 21 of file TransformInterfaces.cpp.
#define DEBUG_TYPE_FULL "transform-dialect-full" |
Definition at line 22 of file TransformInterfaces.cpp.
#define FULL_LDBG | ( | X | ) | DEBUG_WITH_TYPE(DEBUG_TYPE_FULL, (DBGS() << (X))) |
Definition at line 26 of file TransformInterfaces.cpp.
#define LDBG | ( | X | ) | LLVM_DEBUG(DBGS() << (X)) |
Definition at line 25 of file TransformInterfaces.cpp.
|
static |
Definition at line 1500 of file TransformInterfaces.cpp.
DiagnosedSilenceableFailure checkRepeatedConsumptionInOperand | ( | ArrayRef< T > | payload, |
transform::TransformOpInterface | transform, | ||
unsigned | operandNumber | ||
) |
Definition at line 783 of file TransformInterfaces.cpp.
References diag(), and mlir::DiagnosedSilenceableFailure::success().
|
static |
Given a list of MappedValues, cast them to the value kind implied by the interface of the handle type, and dispatch to one of the callbacks.
Definition at line 136 of file TransformInterfaces.cpp.
References mlir::DiagnosedSilenceableFailure::definiteFailure(), mlir::emitSilenceableFailure(), mlir::Value::getLoc(), mlir::Value::getType(), and mlir::DiagnosedSilenceableFailure::success().
Referenced by mlir::transform::TransformState::mapBlockArgument(), and mlir::transform::TransformResults::setMappedValues().
void dropMappingEntry | ( | Mapping & | mapping, |
Key | key, | ||
Mapped | mapped | ||
) |
Definition at line 316 of file TransformInterfaces.cpp.
Return true if a
happens before b
, i.e., a
or one of its ancestors properly dominates b
and b
is not inside a
.
Definition at line 36 of file TransformInterfaces.cpp.
References mlir::Block::findAncestorOpInBlock(), mlir::Operation::getBlock(), mlir::Operation::getParentOp(), mlir::Operation::isBeforeInBlock(), and mlir::Operation::isProperAncestor().
|
static |
Returns true
if the given list of effects instances contains an instance with the effect type specified as template parameter.
Definition at line 1810 of file TransformInterfaces.cpp.
References mlir::SideEffects::EffectInstance< EffectT >::getEffect(), and mlir::SideEffects::EffectInstance< EffectT >::getResource().
|
static |
Appends to effects
the same effects as the operations of block
have on block arguments but associated with operands.
Definition at line 1615 of file TransformInterfaces.cpp.
References mlir::SideEffects::Resource::Base< PayloadIRResource >::get(), mlir::Block::getArguments(), and remapEffects().
Referenced by mlir::transform::detail::getPotentialTopLevelEffects().
|
static |
Appends to effects
the memory effect instances on target
with the same resource and effect as the ones the operation iface
having on source
.
Definition at line 1603 of file TransformInterfaces.cpp.
Referenced by remapArgumentEffects().