aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riddleriver@gmail.com>2020-03-14 13:36:42 -0700
committerRiver Riddle <riddleriver@gmail.com>2020-03-14 13:37:56 -0700
commit43959a25927699def4feef8b9b9b25931118e887 (patch)
tree9e55300ebc1cabc27b58bbc519a129a38072020a /mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
parenteda58ac04cfa95298583223ba6779916e4721550 (diff)
downloadllvm-43959a25927699def4feef8b9b9b25931118e887.zip
llvm-43959a25927699def4feef8b9b9b25931118e887.tar.gz
llvm-43959a25927699def4feef8b9b9b25931118e887.tar.bz2
[mlir][NFC] Move the LoopLike interface out of Transforms/ and into Interfaces/
Differential Revision: https://reviews.llvm.org/D76155
Diffstat (limited to 'mlir/lib/Transforms/LoopInvariantCodeMotion.cpp')
-rw-r--r--mlir/lib/Transforms/LoopInvariantCodeMotion.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
index 7300948..e616663 100644
--- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
+++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp
@@ -14,9 +14,9 @@
#include "mlir/IR/Builders.h"
#include "mlir/IR/Function.h"
+#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Interfaces/SideEffects.h"
#include "mlir/Pass/Pass.h"
-#include "mlir/Transforms/LoopLikeInterface.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -26,12 +26,12 @@
using namespace mlir;
namespace {
-
/// Loop invariant code motion (LICM) pass.
struct LoopInvariantCodeMotion : public OperationPass<LoopInvariantCodeMotion> {
public:
void runOnOperation() override;
};
+} // end anonymous namespace
// Checks whether the given op can be hoisted by checking that
// - the op and any of its contained operations do not depend on SSA values
@@ -107,8 +107,6 @@ static LogicalResult moveLoopInvariantCode(LoopLikeOpInterface looplike) {
return result;
}
-} // end anonymous namespace
-
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
@@ -120,11 +118,6 @@ void LoopInvariantCodeMotion::runOnOperation() {
});
}
-// Include the generated code for the loop-like interface here, as it otherwise
-// has no compilation unit. This works as loop-invariant code motion is the
-// only user of that interface.
-#include "mlir/Transforms/LoopLikeInterface.cpp.inc"
-
std::unique_ptr<Pass> mlir::createLoopInvariantCodeMotionPass() {
return std::make_unique<LoopInvariantCodeMotion>();
}