From 2be8af8f0e0780901213b6fd3013a5268ddc3359 Mon Sep 17 00:00:00 2001 From: Michele Scuttari Date: Tue, 30 Aug 2022 21:56:31 +0200 Subject: [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 --- mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'mlir/lib/Transforms/LoopInvariantCodeMotion.cpp') diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp index 35e0f48..a0f738b 100644 --- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp +++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp @@ -10,30 +10,34 @@ // //===----------------------------------------------------------------------===// -#include "PassDetail.h" +#include "mlir/Transforms/Passes.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 LoopInvariantCodeMotion - : public LoopInvariantCodeMotionBase { +struct LoopInvariantCodeMotionPass + : public impl::LoopInvariantCodeMotionPassBase< + LoopInvariantCodeMotionPass> { + using LoopInvariantCodeMotionPassBase::LoopInvariantCodeMotionPassBase; + void runOnOperation() override; }; } // namespace -void LoopInvariantCodeMotion::runOnOperation() { +void LoopInvariantCodeMotionPass::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 mlir::createLoopInvariantCodeMotionPass() { - return std::make_unique(); -} -- cgit v1.1