forked from OSchip/llvm-project
[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:
parent
0d3054fb44
commit
8d89179e33
|
@ -1391,8 +1391,8 @@ public:
|
|||
return getRegion()->contains(L);
|
||||
}
|
||||
|
||||
/// Return whether this statement contains @p BB.
|
||||
bool contains(BasicBlock *BB) const {
|
||||
/// Return whether this statement represents @p BB.
|
||||
bool represents(BasicBlock *BB) const {
|
||||
if (isCopyStmt())
|
||||
return false;
|
||||
if (isBlockStmt())
|
||||
|
@ -1404,7 +1404,7 @@ public:
|
|||
bool contains(Instruction *Inst) const {
|
||||
if (!Inst)
|
||||
return false;
|
||||
return contains(Inst->getParent());
|
||||
return represents(Inst->getParent());
|
||||
}
|
||||
|
||||
/// Return the closest innermost loop that contains this statement, but is not
|
||||
|
|
|
@ -658,7 +658,7 @@ void ScopBuilder::buildAccessFunctions(ScopStmt *Stmt, BasicBlock &BB,
|
|||
assert(
|
||||
!Stmt == IsExitBlock &&
|
||||
"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
|
||||
// instructions we can not model.
|
||||
|
|
|
@ -1600,7 +1600,7 @@ void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, PHINode *PHI,
|
|||
BasicBlock *BBCopyEnd = EndBlockMap[IncomingBB];
|
||||
if (!BBCopyStart) {
|
||||
assert(!BBCopyEnd);
|
||||
assert(Stmt.contains(IncomingBB) &&
|
||||
assert(Stmt.represents(IncomingBB) &&
|
||||
"Bad incoming block for PHI in non-affine region");
|
||||
IncompletePHINodeMap[IncomingBB].push_back(std::make_pair(PHI, PHICopy));
|
||||
return;
|
||||
|
@ -1612,7 +1612,7 @@ void RegionGenerator::addOperandToPHI(ScopStmt &Stmt, PHINode *PHI,
|
|||
|
||||
Value *OpCopy = nullptr;
|
||||
|
||||
if (Stmt.contains(IncomingBB)) {
|
||||
if (Stmt.represents(IncomingBB)) {
|
||||
Value *Op = PHI->getIncomingValueForBlock(IncomingBB);
|
||||
|
||||
// If the current insert block is different from the PHIs incoming block
|
||||
|
|
|
@ -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
|
||||
// there is a MemoryAccess that reads its value that has been written by
|
||||
// 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, Intra, nullptr, nullptr);
|
||||
|
|
Loading…
Reference in New Issue