aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/LoopInvariantCodeMotion.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/LoopInvariantCodeMotion.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/LoopInvariantCodeMotion.cpp')
-rw-r--r--mlir/lib/Transforms/LoopInvariantCodeMotion.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
index a0f738b..35e0f48 100644
--- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
+++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
@@ -10,34 +10,30 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Transforms/Passes.h"
-
+#include "PassDetail.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Transforms/LoopInvariantCodeMotionUtils.h"
+#include "mlir/Transforms/Passes.h"
#include "mlir/Transforms/SideEffectUtils.h"
-namespace mlir {
-#define GEN_PASS_DEF_LOOPINVARIANTCODEMOTIONPASS
-#include "mlir/Transforms/Passes.h.inc"
-} // namespace mlir
-
using namespace mlir;
namespace {
/// Loop invariant code motion (LICM) pass.
-struct LoopInvariantCodeMotionPass
- : public impl::LoopInvariantCodeMotionPassBase<
- LoopInvariantCodeMotionPass> {
- using LoopInvariantCodeMotionPassBase::LoopInvariantCodeMotionPassBase;
-
+struct LoopInvariantCodeMotion
+ : public LoopInvariantCodeMotionBase<LoopInvariantCodeMotion> {
void runOnOperation() override;
};
} // namespace
-void LoopInvariantCodeMotionPass::runOnOperation() {
+void LoopInvariantCodeMotion::runOnOperation() {
// Walk through all loops in a function in innermost-loop-first order. This
// way, we first LICM from the inner loop, and place the ops in
// the outer loop, which in turn can be further LICM'ed.
getOperation()->walk(
[&](LoopLikeOpInterface loopLike) { moveLoopInvariantCode(loopLike); });
}
+
+std::unique_ptr<Pass> mlir::createLoopInvariantCodeMotionPass() {
+ return std::make_unique<LoopInvariantCodeMotion>();
+}