aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/ControlFlowSink.cpp
diff options
context:
space:
mode:
authorMichele Scuttari <michele.scuttari@outlook.com>2022-08-30 21:56:31 +0200
committerMichele Scuttari <michele.scuttari@outlook.com>2022-08-30 21:56:31 +0200
commit2be8af8f0e0780901213b6fd3013a5268ddc3359 (patch)
treeb92b5c6894a41f1b24c858d1d9cf18f9d12574ec /mlir/lib/Transforms/ControlFlowSink.cpp
parent999886325e825747d5aff5c447b20d12fec7b57a (diff)
downloadllvm-2be8af8f0e0780901213b6fd3013a5268ddc3359.zip
llvm-2be8af8f0e0780901213b6fd3013a5268ddc3359.tar.gz
llvm-2be8af8f0e0780901213b6fd3013a5268ddc3359.tar.bz2
[MLIR] Update pass declarations to new autogenerated files
The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow dropping the old infrastructure. Reviewed By: mehdi_amini, rriddle Differential Review: https://reviews.llvm.org/D132838
Diffstat (limited to 'mlir/lib/Transforms/ControlFlowSink.cpp')
-rw-r--r--mlir/lib/Transforms/ControlFlowSink.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/mlir/lib/Transforms/ControlFlowSink.cpp b/mlir/lib/Transforms/ControlFlowSink.cpp
index 5b0cfc2..960a035 100644
--- a/mlir/lib/Transforms/ControlFlowSink.cpp
+++ b/mlir/lib/Transforms/ControlFlowSink.cpp
@@ -13,24 +13,32 @@
//
//===----------------------------------------------------------------------===//
-#include "PassDetail.h"
+#include "mlir/Transforms/Passes.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 ControlFlowSink : public ControlFlowSinkBase<ControlFlowSink> {
+struct ControlFlowSinkPass
+ : public impl::ControlFlowSinkPassBase<ControlFlowSinkPass> {
+ using ControlFlowSinkPassBase::ControlFlowSinkPassBase;
+
void runOnOperation() override;
};
} // end anonymous namespace
-void ControlFlowSink::runOnOperation() {
+void ControlFlowSinkPass::runOnOperation() {
auto &domInfo = getAnalysis<DominanceInfo>();
getOperation()->walk([&](RegionBranchOpInterface branch) {
SmallVector<Region *> regionsToSink;
@@ -48,7 +56,3 @@ void ControlFlowSink::runOnOperation() {
});
});
}
-
-std::unique_ptr<Pass> mlir::createControlFlowSinkPass() {
- return std::make_unique<ControlFlowSink>();
-}