15#include "llvm/ADT/DenseSet.h"
21#define GEN_PASS_DEF_INFEREFFECTSPASS
22#include "mlir/Dialect/Transform/Transforms/Passes.h.inc"
27 if (!isa<transform::TransformOpInterface>(op))
30 auto func = dyn_cast<FunctionOpInterface>(op);
34 if (!
func.getFunctionBody().hasOneBlock()) {
36 <<
"only single-block operations are currently supported";
41 llvm::SmallDenseSet<unsigned> consumedArguments;
45 for (
unsigned i = 0, e =
func.getNumArguments(); i < e; ++i) {
47 consumedArguments.contains(i)
48 ? transform::TransformDialect::kArgConsumedAttrName
49 : transform::TransformDialect::kArgReadOnlyAttrName,
57 :
public transform::impl::InferEffectsPassBase<InferEffectsPass> {
59 void runOnOperation()
override {
60 WalkResult
result = getOperation()->walk([](Operation *op) {
62 : WalkResult::advance();
64 if (
result.wasInterrupted())
65 return signalPassFailure();
static LogicalResult inferSideEffectAnnotations(Operation *op)
Operation is the basic unit of execution within MLIR.
InFlightDiagnostic emitError(const Twine &message={})
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers tha...
MLIRContext * getContext()
Return the context this operation is associated with.
static WalkResult interrupt()
Include the generated interface declarations.