[ScopInfo] Rename ScopStmt::contains(BB) to represents(BB). NFC.

In future, there will be no more a 1:1 correspondence between statements
and basic blocks, the name `contains` does not correctly capture their
relationship. A BB may infact comprise of multiple statements; hence we
describe a statement 'representing' a basic block.

Differential Revision: https://reviews.llvm.org/D35838

llvm-svn: 308982
This commit is contained in:
Michael Kruse 2017-07-25 16:25:37 +00:00
parent 0d3054fb44
commit 8d89179e33
4 changed files with 7 additions and 7 deletions

View File

@ -1391,8 +1391,8 @@ public:
return getRegion()->contains(L); return getRegion()->contains(L);
} }
/// Return whether this statement contains @p BB. /// Return whether this statement represents @p BB.
bool contains(BasicBlock *BB) const { bool represents(BasicBlock *BB) const {
if (isCopyStmt()) if (isCopyStmt())
return false; return false;
if (isBlockStmt()) if (isBlockStmt())
@ -1404,7 +1404,7 @@ public:
bool contains(Instruction *Inst) const { bool contains(Instruction *Inst) const {
if (!Inst) if (!Inst)
return false; return false;
return contains(Inst->getParent()); return represents(Inst->getParent());
} }
/// Return the closest innermost loop that contains this statement, but is not /// Return the closest innermost loop that contains this statement, but is not

View File

@ -658,7 +658,7 @@ void ScopBuilder::buildAccessFunctions(ScopStmt *Stmt, BasicBlock &BB,
assert( assert(
!Stmt == IsExitBlock && !Stmt == IsExitBlock &&
"The exit BB is the only one that cannot be represented by a statement"); "The exit BB is the only one that cannot be represented by a statement");
assert(IsExitBlock || Stmt->contains(&BB)); assert(IsExitBlock || Stmt->represents(&BB));
// We do not build access functions for error blocks, as they may contain // We do not build access functions for error blocks, as they may contain
// instructions we can not model. // instructions we can not model.

View File

@ -1600,7 +1600,7 @@ void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, PHINode *PHI,
BasicBlock *BBCopyEnd = EndBlockMap[IncomingBB]; BasicBlock *BBCopyEnd = EndBlockMap[IncomingBB];
if (!BBCopyStart) { if (!BBCopyStart) {
assert(!BBCopyEnd); assert(!BBCopyEnd);
assert(Stmt.contains(IncomingBB) && assert(Stmt.represents(IncomingBB) &&
"Bad incoming block for PHI in non-affine region"); "Bad incoming block for PHI in non-affine region");
IncompletePHINodeMap[IncomingBB].push_back(std::make_pair(PHI, PHICopy)); IncompletePHINodeMap[IncomingBB].push_back(std::make_pair(PHI, PHICopy));
return; return;
@ -1612,7 +1612,7 @@ void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, PHINode *PHI,
Value *OpCopy = nullptr; Value *OpCopy = nullptr;
if (Stmt.contains(IncomingBB)) { if (Stmt.represents(IncomingBB)) {
Value *Op = PHI->getIncomingValueForBlock(IncomingBB); Value *Op = PHI->getIncomingValueForBlock(IncomingBB);
// If the current insert block is different from the PHIs incoming block // If the current insert block is different from the PHIs incoming block

View File

@ -73,7 +73,7 @@ VirtualUse VirtualUse::create(Scop *S, ScopStmt *UserStmt, Loop *UserScope,
// A use is inter-statement if either it is defined in another statement, or // A use is inter-statement if either it is defined in another statement, or
// there is a MemoryAccess that reads its value that has been written by // there is a MemoryAccess that reads its value that has been written by
// another statement. // another statement.
if (InputMA || (!Virtual && !UserStmt->contains(Inst->getParent()))) if (InputMA || (!Virtual && !UserStmt->represents(Inst->getParent())))
return VirtualUse(UserStmt, Val, Inter, nullptr, InputMA); return VirtualUse(UserStmt, Val, Inter, nullptr, InputMA);
return VirtualUse(UserStmt, Val, Intra, nullptr, nullptr); return VirtualUse(UserStmt, Val, Intra, nullptr, nullptr);