aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/ControlFlowSink.cpp
diff options
context:
space:
mode:
authorMichele Scuttari <michele.scuttari@outlook.com>2022-08-30 22:20:36 +0200
committerMichele Scuttari <michele.scuttari@outlook.com>2022-08-30 22:21:55 +0200
commit039b969b32b64b64123dce30dd28ec4e343d893f (patch)
tree2e3764eb215056ebd3aeb607b82c3c807bcbc38c /mlir/lib/Transforms/ControlFlowSink.cpp
parent349e5bd24e72ebc568c0d171cc9f3aca2674a1db (diff)
downloadllvm-039b969b32b64b64123dce30dd28ec4e343d893f.zip
llvm-039b969b32b64b64123dce30dd28ec4e343d893f.tar.gz
llvm-039b969b32b64b64123dce30dd28ec4e343d893f.tar.bz2
Revert "[MLIR] Update pass declarations to new autogenerated files"
This reverts commit 2be8af8f0e0780901213b6fd3013a5268ddc3359.
Diffstat (limited to 'mlir/lib/Transforms/ControlFlowSink.cpp')
-rw-r--r--mlir/lib/Transforms/ControlFlowSink.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/mlir/lib/Transforms/ControlFlowSink.cpp b/mlir/lib/Transforms/ControlFlowSink.cpp
index 960a035..5b0cfc2 100644
--- a/mlir/lib/Transforms/ControlFlowSink.cpp
+++ b/mlir/lib/Transforms/ControlFlowSink.cpp
@@ -13,32 +13,24 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Transforms/Passes.h"
-
+#include "PassDetail.h"
#include "mlir/IR/Dominance.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Transforms/ControlFlowSinkUtils.h"
+#include "mlir/Transforms/Passes.h"
#include "mlir/Transforms/SideEffectUtils.h"
-namespace mlir {
-#define GEN_PASS_DEF_CONTROLFLOWSINKPASS
-#include "mlir/Transforms/Passes.h.inc"
-} // namespace mlir
-
using namespace mlir;
namespace {
/// A control-flow sink pass.
-struct ControlFlowSinkPass
- : public impl::ControlFlowSinkPassBase<ControlFlowSinkPass> {
- using ControlFlowSinkPassBase::ControlFlowSinkPassBase;
-
+struct ControlFlowSink : public ControlFlowSinkBase<ControlFlowSink> {
void runOnOperation() override;
};
} // end anonymous namespace
-void ControlFlowSinkPass::runOnOperation() {
+void ControlFlowSink::runOnOperation() {
auto &domInfo = getAnalysis<DominanceInfo>();
getOperation()->walk([&](RegionBranchOpInterface branch) {
SmallVector<Region *> regionsToSink;
@@ -56,3 +48,7 @@ void ControlFlowSinkPass::runOnOperation() {
});
});
}
+
+std::unique_ptr<Pass> mlir::createControlFlowSinkPass() {
+ return std::make_unique<ControlFlowSink>();
+}