diff options
| author | Sean Silva <silvasean@google.com> | 2019-11-06 16:08:51 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-06 16:09:23 -0800 |
| commit | f6188b5b07418dda04743a51f0ddcbca30c7a196 (patch) | |
| tree | b79dba9d95434e1f89a416a978ee04dc3267d6e9 /mlir/lib/IR | |
| parent | ffebc8ce1d876837c706a17d2ccb7a597d93dd74 (diff) | |
| download | bcm5719-llvm-f6188b5b07418dda04743a51f0ddcbca30c7a196.tar.gz bcm5719-llvm-f6188b5b07418dda04743a51f0ddcbca30c7a196.zip | |
Replace some remnant uses of "inst" with "op".
PiperOrigin-RevId: 278961676
Diffstat (limited to 'mlir/lib/IR')
| -rw-r--r-- | mlir/lib/IR/Block.cpp | 36 | ||||
| -rw-r--r-- | mlir/lib/IR/Operation.cpp | 14 | ||||
| -rw-r--r-- | mlir/lib/IR/Region.cpp | 6 |
3 files changed, 27 insertions, 29 deletions
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); } |

