diff options
| author | Amit Sabne <asabne@google.com> | 2019-04-17 13:39:41 -0700 |
|---|---|---|
| committer | Mehdi Amini <joker.eph@gmail.com> | 2019-04-18 11:49:39 -0700 |
| commit | 4aa9235ae0ea4e4b0502640b65b298272908f66b (patch) | |
| tree | 05558067a0d279d2a1a328b88f9491d90a0d132e /mlir/lib | |
| parent | 7905da656ed69743f38ecc34bdbfc996786677c6 (diff) | |
| download | bcm5719-llvm-4aa9235ae0ea4e4b0502640b65b298272908f66b.tar.gz bcm5719-llvm-4aa9235ae0ea4e4b0502640b65b298272908f66b.zip | |
Fix LLVM_DEBUG instances
--
PiperOrigin-RevId: 244058051
Diffstat (limited to 'mlir/lib')
| -rw-r--r-- | mlir/lib/Transforms/LoopInvariantCodeMotion.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp index b1bee484709..13e9cda2407 100644 --- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp +++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp @@ -79,9 +79,10 @@ void LoopInvariantCodeMotion::runOnAffineForOp(AffineForOp forOp) { // definition closure following the loop induction variable. getForwardSlice(forOp, &loopDefinedOps); - for (auto i : loopDefinedOps) { - LLVM_DEBUG(i->print(llvm::dbgs() << "\nLoop-dependent op\n")); - } + LLVM_DEBUG(for (auto i + : loopDefinedOps) { + (i->print(llvm::dbgs() << "\nLoop-dependent op\n")); + }); for (auto &op : *loopBody) { // If the operation is loop invariant, insert it into opsToMove. @@ -118,10 +119,9 @@ void LoopInvariantCodeMotion::runOnFunction() { [&](AffineForOp forOp) { forOps.push_back(forOp); }); // We gather loops first, and then go over them later because we don't want to // mess the iterators up. - for (auto forOp : forOps) { - auto *forInst = forOp.getOperation(); - LLVM_DEBUG(forInst->print(llvm::dbgs() << "\nOriginal loop\n")); - runOnAffineForOp(forOp); + for (auto op : forOps) { + LLVM_DEBUG(op.getOperation()->print(llvm::dbgs() << "\nOriginal loop\n")); + runOnAffineForOp(op); } } |

