diff options
| author | Uday Bondhugula <udayb@iisc.ac.in> | 2019-09-27 11:57:52 -0700 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-09-27 11:58:24 -0700 |
| commit | 74eabdd14eb3ed697d6dc4d72c3423ec81dd80f4 (patch) | |
| tree | 9d43312d5e2477b49aeefdbe382d046e1941d53c /mlir/lib/Transforms | |
| parent | ddf737c5da728f25c5e0413bc737d04b2d92df96 (diff) | |
| download | bcm5719-llvm-74eabdd14eb3ed697d6dc4d72c3423ec81dd80f4.tar.gz bcm5719-llvm-74eabdd14eb3ed697d6dc4d72c3423ec81dd80f4.zip | |
NFC - clean up op accessor usage, std.load/store op verify, other stale info
- also remove stale terminology/references in docs
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#148
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/148 from bondhugula:cleanup e846b641a3c2936e874138aff480a23cdbf66591
PiperOrigin-RevId: 271618279
Diffstat (limited to 'mlir/lib/Transforms')
| -rw-r--r-- | mlir/lib/Transforms/LoopTiling.cpp | 2 | ||||
| -rw-r--r-- | mlir/lib/Transforms/LowerAffine.cpp | 2 | ||||
| -rw-r--r-- | mlir/lib/Transforms/MaterializeVectors.cpp | 2 | ||||
| -rw-r--r-- | mlir/lib/Transforms/Utils/LoopFusionUtils.cpp | 6 | ||||
| -rw-r--r-- | mlir/lib/Transforms/Utils/LoopUtils.cpp | 5 |
5 files changed, 7 insertions, 10 deletions
diff --git a/mlir/lib/Transforms/LoopTiling.cpp b/mlir/lib/Transforms/LoopTiling.cpp index d90e727b0ac..af1ecd06ee6 100644 --- a/mlir/lib/Transforms/LoopTiling.cpp +++ b/mlir/lib/Transforms/LoopTiling.cpp @@ -190,7 +190,7 @@ LogicalResult mlir::tileCodeGen(MutableArrayRef<AffineForOp> band, // Check if the supplied for op's are all successively nested. for (unsigned i = 1, e = band.size(); i < e; i++) { - assert(band[i].getOperation()->getParentOp() == band[i - 1].getOperation()); + assert(band[i].getParentOp() == band[i - 1].getOperation()); } auto origLoops = band; diff --git a/mlir/lib/Transforms/LowerAffine.cpp b/mlir/lib/Transforms/LowerAffine.cpp index 045cf04274c..72d52b9a4f5 100644 --- a/mlir/lib/Transforms/LowerAffine.cpp +++ b/mlir/lib/Transforms/LowerAffine.cpp @@ -335,7 +335,7 @@ public: // Now we just have to handle the condition logic. auto integerSet = op.getIntegerSet(); Value *zeroConstant = rewriter.create<ConstantIndexOp>(loc, 0); - SmallVector<Value *, 8> operands(op.getOperation()->getOperands()); + SmallVector<Value *, 8> operands(op.getOperands()); auto operandsRef = llvm::makeArrayRef(operands); // Calculate cond as a conjunction without short-circuiting. diff --git a/mlir/lib/Transforms/MaterializeVectors.cpp b/mlir/lib/Transforms/MaterializeVectors.cpp index 08bd6644111..a0b60dd3648 100644 --- a/mlir/lib/Transforms/MaterializeVectors.cpp +++ b/mlir/lib/Transforms/MaterializeVectors.cpp @@ -721,7 +721,7 @@ static bool materialize(FuncOp f, const SetVector<Operation *> &terminators, if (fail) { return true; } - LLVM_DEBUG(dbgs() << "\nMLFunction is now\n"); + LLVM_DEBUG(dbgs() << "\nFunction is now\n"); LLVM_DEBUG(f.print(dbgs())); } return false; diff --git a/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp b/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp index 8f96cc23fb9..7b2c323b806 100644 --- a/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp +++ b/mlir/lib/Transforms/Utils/LoopFusionUtils.cpp @@ -187,7 +187,7 @@ static bool gatherLoadsAndStores(AffineForOp forOp, SmallVectorImpl<Operation *> &loadAndStoreOps) { bool hasIfOp = false; - forOp.getOperation()->walk([&](Operation *op) { + forOp.walk([&](Operation *op) { if (isa<AffineLoadOp>(op) || isa<AffineStoreOp>(op)) loadAndStoreOps.push_back(op); else if (isa<AffineIfOp>(op)) @@ -261,7 +261,7 @@ FusionResult mlir::canFuseLoops(AffineForOp srcForOp, AffineForOp dstForOp, bool mlir::getLoopNestStats(AffineForOp forOpRoot, LoopNestStats *stats) { auto walkResult = forOpRoot.walk([&](AffineForOp forOp) { auto *childForOp = forOp.getOperation(); - auto *parentForOp = forOp.getOperation()->getParentOp(); + auto *parentForOp = forOp.getParentOp(); if (!llvm::isa<FuncOp>(parentForOp)) { if (!isa<AffineForOp>(parentForOp)) { LLVM_DEBUG(llvm::dbgs() << "Expected parent AffineForOp"); @@ -444,7 +444,7 @@ bool mlir::getFusionComputeCost(AffineForOp srcForOp, LoopNestStats &srcStats, // forwarding to remove. unsigned storeCount = 0; llvm::SmallDenseSet<Value *, 4> storeMemrefs; - srcForOp.getOperation()->walk([&](Operation *op) { + srcForOp.walk([&](Operation *op) { if (auto storeOp = dyn_cast<AffineStoreOp>(op)) { storeMemrefs.insert(storeOp.getMemRef()); ++storeCount; diff --git a/mlir/lib/Transforms/Utils/LoopUtils.cpp b/mlir/lib/Transforms/Utils/LoopUtils.cpp index f7dd02ff877..1872044b0fb 100644 --- a/mlir/lib/Transforms/Utils/LoopUtils.cpp +++ b/mlir/lib/Transforms/Utils/LoopUtils.cpp @@ -367,10 +367,7 @@ void getPerfectlyNestedLoopsImpl( unsigned maxLoops = std::numeric_limits<unsigned>::max()) { for (unsigned i = 0; i < maxLoops; ++i) { forOps.push_back(rootForOp); - // FIXME: ForOp and AffineForOp currently provide different names to access - // the region ("region" and "getRegion"). Remove this generic access when - // AffineForOp moves to ODS and also gets "region". - Block &body = rootForOp.getOperation()->getRegion(0).front(); + Block &body = rootForOp.region().front(); if (body.begin() != std::prev(body.end(), 2)) return; |

