#include "TestDialect.h"
#include "TestOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Transforms/RegionUtils.h"
usingnamespacemlir;
static LogicalResult
makeIsolatedFromAboveImpl(RewriterBase &rewriter,
test::OneRegionWithOperandsOp regionOp,
llvm::function_ref<bool(Operation *)> callBack) { … }
namespace {
struct SimpleMakeIsolatedFromAbove
: OpRewritePattern<test::OneRegionWithOperandsOp> { … };
struct MakeIsolatedFromAboveAndCloneOpsWithNoOperands
: OpRewritePattern<test::OneRegionWithOperandsOp> { … };
struct MakeIsolatedFromAboveAndCloneOpsWithOperands
: OpRewritePattern<test::OneRegionWithOperandsOp> { … };
struct TestMakeIsolatedFromAbovePass
: public PassWrapper<TestMakeIsolatedFromAbovePass,
OperationPass<func::FuncOp>> { … };
}
void TestMakeIsolatedFromAbovePass::runOnOperation() { … }
namespace mlir {
namespace test {
void registerTestMakeIsolatedFromAbovePass() { … }
}
}