diff options
author | Matthias Springer <me@m-sp.org> | 2023-11-05 11:40:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-05 11:40:51 +0900 |
commit | b9fe461e7382875156890b286d53b4429fcaa588 (patch) | |
tree | 319fe5dc9d1551043476751f7f2236220f54c9f6 /mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | |
parent | f0535c72bf574fe4c5a46925670591e79ce39959 (diff) | |
download | llvm-b9fe461e7382875156890b286d53b4429fcaa588.zip llvm-b9fe461e7382875156890b286d53b4429fcaa588.tar.gz llvm-b9fe461e7382875156890b286d53b4429fcaa588.tar.bz2 |
[mlir][transform] LISH: Add transform op (#70630)
Add a transform op for loop-invariant subset hoisting. Delete the old
transform op from the Linalg dialect.
Diffstat (limited to 'mlir/lib/Transforms/LoopInvariantCodeMotion.cpp')
-rw-r--r-- | mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp index e6d8af8..02c3ea1 100644 --- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp +++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp @@ -12,6 +12,7 @@ #include "mlir/Transforms/Passes.h" +#include "mlir/IR/PatternMatch.h" #include "mlir/Interfaces/LoopLikeInterface.h" #include "mlir/Interfaces/SideEffectInterfaces.h" #include "mlir/Transforms/LoopInvariantCodeMotionUtils.h" @@ -47,11 +48,12 @@ void LoopInvariantCodeMotion::runOnOperation() { } void LoopInvariantSubsetHoisting::runOnOperation() { + IRRewriter rewriter(getOperation()->getContext()); // Walk through all loops in a function in innermost-loop-first order. This // way, we first hoist from the inner loop, and place the ops in the outer // loop, which in turn can be further hoisted from. getOperation()->walk([&](LoopLikeOpInterface loopLike) { - (void)hoistLoopInvariantSubsets(loopLike); + (void)hoistLoopInvariantSubsets(rewriter, loopLike); }); } |