diff options
| author | Chris Lattner <clattner@google.com> | 2018-12-28 13:07:39 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 14:43:58 -0700 |
| commit | 315a466aed9bcc896007098719ed9e0a35a3459d (patch) | |
| tree | 5de796018001a55709d69fc51d362197680d315c /mlir/lib/Analysis/Utils.cpp | |
| parent | 2a463c36b1f1cc42e585144a9b012cf948baa708 (diff) | |
| download | bcm5719-llvm-315a466aed9bcc896007098719ed9e0a35a3459d.tar.gz bcm5719-llvm-315a466aed9bcc896007098719ed9e0a35a3459d.zip | |
Rename BasicBlock and StmtBlock to Block, and make a pass cleaning it up. I did not make an effort to rename all of the 'bb' names in the codebase, since they are still correct and any specific missed once can be fixed up on demand.
The last major renaming is Statement -> Instruction, which is why Statement and
Stmt still appears in various places.
This is step 19/n towards merging instructions and statements, NFC.
PiperOrigin-RevId: 227163082
Diffstat (limited to 'mlir/lib/Analysis/Utils.cpp')
| -rw-r--r-- | mlir/lib/Analysis/Utils.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp index e17c27ac941..f6191418f54 100644 --- a/mlir/lib/Analysis/Utils.cpp +++ b/mlir/lib/Analysis/Utils.cpp @@ -44,8 +44,8 @@ bool mlir::properlyDominates(const Statement &a, const Statement &b) { if (a.getBlock() == b.getBlock()) { // Do a linear scan to determine whether b comes after a. - auto aIter = StmtBlock::const_iterator(a); - auto bIter = StmtBlock::const_iterator(b); + auto aIter = Block::const_iterator(a); + auto bIter = Block::const_iterator(b); auto aBlockStart = a.getBlock()->begin(); while (bIter != aBlockStart) { --bIter; @@ -56,7 +56,7 @@ bool mlir::properlyDominates(const Statement &a, const Statement &b) { } // Traverse up b's hierarchy to check if b's block is contained in a's. - if (const auto *bAncestor = a.getBlock()->findAncestorStmtInBlock(b)) + if (const auto *bAncestor = a.getBlock()->findAncestorInstInBlock(b)) // a and bAncestor are in the same block; check if the former dominates it. return dominates(a, *bAncestor); @@ -333,26 +333,26 @@ template bool mlir::boundCheckLoadOrStoreOp(OpPointer<LoadOp> loadOp, template bool mlir::boundCheckLoadOrStoreOp(OpPointer<StoreOp> storeOp, bool emitError); -// Returns in 'positions' the StmtBlock positions of 'stmt' in each ancestor -// StmtBlock from the StmtBlock containing statement, stopping at 'limitBlock'. -static void findStmtPosition(const Statement *stmt, StmtBlock *limitBlock, +// Returns in 'positions' the Block positions of 'stmt' in each ancestor +// Block from the Block containing statement, stopping at 'limitBlock'. +static void findStmtPosition(const Statement *stmt, Block *limitBlock, SmallVectorImpl<unsigned> *positions) { - StmtBlock *block = stmt->getBlock(); + Block *block = stmt->getBlock(); while (block != limitBlock) { - int stmtPosInBlock = block->findStmtPosInBlock(*stmt); + int stmtPosInBlock = block->findInstPositionInBlock(*stmt); assert(stmtPosInBlock >= 0); positions->push_back(stmtPosInBlock); - stmt = block->getContainingStmt(); + stmt = block->getContainingInst(); block = stmt->getBlock(); } std::reverse(positions->begin(), positions->end()); } -// Returns the Statement in a possibly nested set of StmtBlocks, where the +// Returns the Statement in a possibly nested set of Blocks, where the // position of the statement is represented by 'positions', which has a -// StmtBlock position for each level of nesting. +// Block position for each level of nesting. static Statement *getStmtAtPosition(ArrayRef<unsigned> positions, - unsigned level, StmtBlock *block) { + unsigned level, Block *block) { unsigned i = 0; for (auto &stmt : *block) { if (i != positions[level]) { |

