summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-02-04 16:24:44 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:12:59 -0700
commitbf9c381d1dbf4381659597109422e543d62a49d7 (patch)
tree493aaa02d23039a9fcd31b9ff4b3a4f0af91df3a /mlir/lib/Transforms/Utils/LoopUtils.cpp
parentc9ad4621ce2d68cad547da360aedeee733b73f32 (diff)
downloadbcm5719-llvm-bf9c381d1dbf4381659597109422e543d62a49d7.tar.gz
bcm5719-llvm-bf9c381d1dbf4381659597109422e543d62a49d7.zip
Remove InstWalker and move all instruction walking to the api facilities on Function/Block/Instruction.
PiperOrigin-RevId: 232388113
Diffstat (limited to 'mlir/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--mlir/lib/Transforms/Utils/LoopUtils.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp
index 5bf17989bef..95875adca6e 100644
--- a/mlir/lib/Transforms/Utils/LoopUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp
@@ -28,7 +28,6 @@
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
-#include "mlir/IR/InstVisitor.h"
#include "mlir/IR/Instruction.h"
#include "mlir/StandardOps/StandardOps.h"
#include "llvm/ADT/DenseMap.h"
@@ -135,10 +134,8 @@ bool mlir::promoteIfSingleIteration(OpPointer<AffineForOp> forOp) {
/// their body into the containing Block.
void mlir::promoteSingleIterationLoops(Function *f) {
// Gathers all innermost loops through a post order pruned walk.
- f->walkPostOrder([](Instruction *inst) {
- if (auto forOp = inst->dyn_cast<AffineForOp>())
- promoteIfSingleIteration(forOp);
- });
+ f->walkPostOrder<AffineForOp>(
+ [](OpPointer<AffineForOp> forOp) { promoteIfSingleIteration(forOp); });
}
/// Generates a 'for' inst with the specified lower and upper bounds while
OpenPOWER on IntegriCloud