summaryrefslogtreecommitdiffstats
path: root/mlir/lib
diff options
context:
space:
mode:
authorSean Silva <silvasean@google.com>2019-11-06 16:08:51 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-06 16:09:23 -0800
commitf6188b5b07418dda04743a51f0ddcbca30c7a196 (patch)
treeb79dba9d95434e1f89a416a978ee04dc3267d6e9 /mlir/lib
parentffebc8ce1d876837c706a17d2ccb7a597d93dd74 (diff)
downloadbcm5719-llvm-f6188b5b07418dda04743a51f0ddcbca30c7a196.tar.gz
bcm5719-llvm-f6188b5b07418dda04743a51f0ddcbca30c7a196.zip
Replace some remnant uses of "inst" with "op".
PiperOrigin-RevId: 278961676
Diffstat (limited to 'mlir/lib')
-rw-r--r--mlir/lib/Analysis/AffineAnalysis.cpp4
-rw-r--r--mlir/lib/Analysis/Dominance.cpp11
-rw-r--r--mlir/lib/Analysis/LoopAnalysis.cpp6
-rw-r--r--mlir/lib/IR/Block.cpp36
-rw-r--r--mlir/lib/IR/Operation.cpp14
-rw-r--r--mlir/lib/IR/Region.cpp6
-rw-r--r--mlir/lib/Transforms/PipelineDataTransfer.cpp2
7 files changed, 38 insertions, 41 deletions
diff --git a/mlir/lib/Analysis/AffineAnalysis.cpp b/mlir/lib/Analysis/AffineAnalysis.cpp
index c4b88453487..9cf7fa897bf 100644
--- a/mlir/lib/Analysis/AffineAnalysis.cpp
+++ b/mlir/lib/Analysis/AffineAnalysis.cpp
@@ -573,9 +573,9 @@ static bool srcAppearsBeforeDstInAncestralBlock(
getCommonBlock(srcAccess, dstAccess, srcDomain, numCommonLoops);
// Check the dominance relationship between the respective ancestors of the
// src and dst in the Block of the innermost among the common loops.
- auto *srcInst = commonBlock->findAncestorInstInBlock(*srcAccess.opInst);
+ auto *srcInst = commonBlock->findAncestorOpInBlock(*srcAccess.opInst);
assert(srcInst != nullptr);
- auto *dstInst = commonBlock->findAncestorInstInBlock(*dstAccess.opInst);
+ auto *dstInst = commonBlock->findAncestorOpInBlock(*dstAccess.opInst);
assert(dstInst != nullptr);
// Determine whether dstInst comes after srcInst.
diff --git a/mlir/lib/Analysis/Dominance.cpp b/mlir/lib/Analysis/Dominance.cpp
index ed61acfc118..c422578320f 100644
--- a/mlir/lib/Analysis/Dominance.cpp
+++ b/mlir/lib/Analysis/Dominance.cpp
@@ -115,7 +115,7 @@ bool DominanceInfo::properlyDominates(Operation *a, Operation *b) {
return a->isBeforeInBlock(b);
// Traverse up b's hierarchy to check if b's block is contained in a's.
- if (auto *bAncestor = aBlock->findAncestorInstInBlock(*b)) {
+ if (auto *bAncestor = aBlock->findAncestorOpInBlock(*b)) {
// Since we already know that aBlock != bBlock, here bAncestor != b.
// a and bAncestor are in the same block; check if 'a' dominates
// bAncestor.
@@ -128,13 +128,12 @@ bool DominanceInfo::properlyDominates(Operation *a, Operation *b) {
/// Return true if value A properly dominates operation B.
bool DominanceInfo::properlyDominates(Value *a, Operation *b) {
- if (auto *aInst = a->getDefiningOp()) {
+ if (auto *aOp = a->getDefiningOp()) {
// The values defined by an operation do *not* dominate any nested
// operations.
- if (aInst->getParentRegion() != b->getParentRegion() &&
- aInst->isAncestor(b))
+ if (aOp->getParentRegion() != b->getParentRegion() && aOp->isAncestor(b))
return false;
- return properlyDominates(aInst, b);
+ return properlyDominates(aOp, b);
}
// block arguments properly dominate all operations in their own block, so
@@ -170,7 +169,7 @@ bool PostDominanceInfo::properlyPostDominates(Operation *a, Operation *b) {
return b->isBeforeInBlock(a);
// Traverse up b's hierarchy to check if b's block is contained in a's.
- if (auto *bAncestor = a->getBlock()->findAncestorInstInBlock(*b))
+ if (auto *bAncestor = a->getBlock()->findAncestorOpInBlock(*b))
// Since we already know that aBlock != bBlock, here bAncestor != b.
// a and bAncestor are in the same block; check if 'a' postdominates
// bAncestor.
diff --git a/mlir/lib/Analysis/LoopAnalysis.cpp b/mlir/lib/Analysis/LoopAnalysis.cpp
index 55a0ac6df84..b466764a194 100644
--- a/mlir/lib/Analysis/LoopAnalysis.cpp
+++ b/mlir/lib/Analysis/LoopAnalysis.cpp
@@ -375,9 +375,9 @@ bool mlir::isInstwiseShiftValid(AffineForOp forOp, ArrayRef<uint64_t> shifts) {
for (auto *user : result->getUsers()) {
// If an ancestor operation doesn't lie in the block of forOp,
// there is no shift to check.
- if (auto *ancInst = forBody->findAncestorInstInBlock(*user)) {
- assert(forBodyShift.count(ancInst) > 0 && "ancestor expected in map");
- if (shift != forBodyShift[ancInst])
+ if (auto *ancOp = forBody->findAncestorOpInBlock(*user)) {
+ assert(forBodyShift.count(ancOp) > 0 && "ancestor expected in map");
+ if (shift != forBodyShift[ancOp])
return false;
}
}
diff --git a/mlir/lib/IR/Block.cpp b/mlir/lib/IR/Block.cpp
index 858fcc92f8c..a5013bd86fb 100644
--- a/mlir/lib/IR/Block.cpp
+++ b/mlir/lib/IR/Block.cpp
@@ -36,14 +36,12 @@ unsigned BlockArgument::getArgNumber() {
//===----------------------------------------------------------------------===//
Block::~Block() {
- assert(!verifyInstOrder() && "Expected valid operation ordering.");
+ assert(!verifyOpOrder() && "Expected valid operation ordering.");
clear();
llvm::DeleteContainerPointers(arguments);
}
-Region *Block::getParent() const {
- return parentValidInstOrderPair.getPointer();
-}
+Region *Block::getParent() const { return parentValidOpOrderPair.getPointer(); }
/// Returns the closest surrounding operation that contains this block or
/// nullptr if this block is unlinked.
@@ -71,16 +69,16 @@ void Block::erase() {
/// Returns 'op' if 'op' lies in this block, or otherwise finds the
/// ancestor operation of 'op' that lies in this block. Returns nullptr if
/// the latter fails.
-Operation *Block::findAncestorInstInBlock(Operation &op) {
+Operation *Block::findAncestorOpInBlock(Operation &op) {
// Traverse up the operation hierarchy starting from the owner of operand to
- // find the ancestor operation that resides in the block of 'forInst'.
- auto *currInst = &op;
- while (currInst->getBlock() != this) {
- currInst = currInst->getParentOp();
- if (!currInst)
+ // find the ancestor operation that resides in the block of 'forOp'.
+ auto *currOp = &op;
+ while (currOp->getBlock() != this) {
+ currOp = currOp->getParentOp();
+ if (!currOp)
return nullptr;
}
- return currInst;
+ return currOp;
}
/// This drops all operand uses from operations within this block, which is
@@ -101,20 +99,20 @@ void Block::dropAllDefinedValueUses() {
/// Returns true if the ordering of the child operations is valid, false
/// otherwise.
-bool Block::isInstOrderValid() { return parentValidInstOrderPair.getInt(); }
+bool Block::isOpOrderValid() { return parentValidOpOrderPair.getInt(); }
/// Invalidates the current ordering of operations.
-void Block::invalidateInstOrder() {
+void Block::invalidateOpOrder() {
// Validate the current ordering.
- assert(!verifyInstOrder());
- parentValidInstOrderPair.setInt(false);
+ assert(!verifyOpOrder());
+ parentValidOpOrderPair.setInt(false);
}
/// Verifies the current ordering of child operations. Returns false if the
/// order is valid, true otherwise.
-bool Block::verifyInstOrder() {
+bool Block::verifyOpOrder() {
// The order is already known to be invalid.
- if (!isInstOrderValid())
+ if (!isOpOrderValid())
return false;
// The order is valid if there are less than 2 operations.
if (operations.empty() || std::next(operations.begin()) == operations.end())
@@ -132,8 +130,8 @@ bool Block::verifyInstOrder() {
}
/// Recomputes the ordering of child operations within the block.
-void Block::recomputeInstOrder() {
- parentValidInstOrderPair.setInt(true);
+void Block::recomputeOpOrder() {
+ parentValidOpOrderPair.setInt(true);
// TODO(riverriddle) Have non-congruent indices to reduce the number of times
// an insert invalidates the list.
diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp
index a712e427c99..96c488cbefe 100644
--- a/mlir/lib/IR/Operation.cpp
+++ b/mlir/lib/IR/Operation.cpp
@@ -332,8 +332,8 @@ bool Operation::isBeforeInBlock(Operation *other) {
assert(other && other->block == block &&
"Expected other operation to have the same parent block.");
// Recompute the parent ordering if necessary.
- if (!block->isInstOrderValid())
- block->recomputeInstOrder();
+ if (!block->isOpOrderValid())
+ block->recomputeOpOrder();
return orderIndex < other->orderIndex;
}
@@ -384,7 +384,7 @@ void llvm::ilist_traits<::mlir::Operation>::addNodeToList(Operation *op) {
op->block = getContainingBlock();
// Invalidate the block ordering.
- op->block->invalidateInstOrder();
+ op->block->invalidateOpOrder();
}
/// This is a trait method invoked when a operation is removed from a block.
@@ -401,7 +401,7 @@ void llvm::ilist_traits<::mlir::Operation>::transferNodesFromList(
Block *curParent = getContainingBlock();
// Invalidate the ordering of the parent block.
- curParent->invalidateInstOrder();
+ curParent->invalidateOpOrder();
// If we are transferring operations within the same block, the block
// pointer doesn't need to be updated.
@@ -423,10 +423,10 @@ void Operation::erase() {
}
/// Unlink this operation from its current block and insert it right before
-/// `existingInst` which may be in the same or another block in the same
+/// `existingOp` which may be in the same or another block in the same
/// function.
-void Operation::moveBefore(Operation *existingInst) {
- moveBefore(existingInst->getBlock(), existingInst->getIterator());
+void Operation::moveBefore(Operation *existingOp) {
+ moveBefore(existingOp->getBlock(), existingOp->getIterator());
}
/// Unlink this operation from its current basic block and insert it right
diff --git a/mlir/lib/IR/Region.cpp b/mlir/lib/IR/Region.cpp
index 4e408f20e19..a91d36b1e48 100644
--- a/mlir/lib/IR/Region.cpp
+++ b/mlir/lib/IR/Region.cpp
@@ -189,14 +189,14 @@ Region *llvm::ilist_traits<::mlir::Block>::getParentRegion() {
/// We keep the region pointer up to date.
void llvm::ilist_traits<::mlir::Block>::addNodeToList(Block *block) {
assert(!block->getParent() && "already in a region!");
- block->parentValidInstOrderPair.setPointer(getParentRegion());
+ block->parentValidOpOrderPair.setPointer(getParentRegion());
}
/// This is a trait method invoked when an operation is removed from a
/// region. We keep the region pointer up to date.
void llvm::ilist_traits<::mlir::Block>::removeNodeFromList(Block *block) {
assert(block->getParent() && "not already in a region!");
- block->parentValidInstOrderPair.setPointer(nullptr);
+ block->parentValidOpOrderPair.setPointer(nullptr);
}
/// This is a trait method invoked when an operation is moved from one block
@@ -211,5 +211,5 @@ void llvm::ilist_traits<::mlir::Block>::transferNodesFromList(
// Update the 'parent' member of each Block.
for (; first != last; ++first)
- first->parentValidInstOrderPair.setPointer(curParent);
+ first->parentValidOpOrderPair.setPointer(curParent);
}
diff --git a/mlir/lib/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Transforms/PipelineDataTransfer.cpp
index 7e175fb22d2..fdf01351549 100644
--- a/mlir/lib/Transforms/PipelineDataTransfer.cpp
+++ b/mlir/lib/Transforms/PipelineDataTransfer.cpp
@@ -218,7 +218,7 @@ static void findMatchingStartFinishInsts(
// We can double buffer regardless of dealloc's outside the loop.
if (isa<DeallocOp>(user))
continue;
- if (!forOp.getBody()->findAncestorInstInBlock(*user)) {
+ if (!forOp.getBody()->findAncestorOpInBlock(*user)) {
LLVM_DEBUG(llvm::dbgs()
<< "can't pipeline: buffer is live out of loop\n";);
escapingUses = true;
OpenPOWER on IntegriCloud