diff options
author | Michele Scuttari <michele.scuttari@outlook.com> | 2022-08-30 21:56:31 +0200 |
---|---|---|
committer | Michele Scuttari <michele.scuttari@outlook.com> | 2022-08-30 21:56:31 +0200 |
commit | 2be8af8f0e0780901213b6fd3013a5268ddc3359 (patch) | |
tree | b92b5c6894a41f1b24c858d1d9cf18f9d12574ec /mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | |
parent | 999886325e825747d5aff5c447b20d12fec7b57a (diff) | |
download | llvm-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/LoopInvariantCodeMotion.cpp')
-rw-r--r-- | mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
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<LoopInvariantCodeMotion> { +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<Pass> mlir::createLoopInvariantCodeMotionPass() { - return std::make_unique<LoopInvariantCodeMotion>(); -} |