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

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 09:25:37 PDT 2017


Author: meinersbur
Date: Tue Jul 25 09:25:37 2017
New Revision: 308982

URL: http://llvm.org/viewvc/llvm-project?rev=308982&view=rev
Log:
[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

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopBuilder.cpp
    polly/trunk/lib/CodeGen/BlockGenerators.cpp
    polly/trunk/lib/Support/VirtualInstruction.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=308982&r1=308981&r2=308982&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Tue Jul 25 09:25:37 2017
@@ -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

Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=308982&r1=308981&r2=308982&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Tue Jul 25 09:25:37 2017
@@ -658,7 +658,7 @@ void ScopBuilder::buildAccessFunctions(S
   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.

Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=308982&r1=308981&r2=308982&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Tue Jul 25 09:25:37 2017
@@ -1600,7 +1600,7 @@ void RegionGenerator::addOperandToPHI(Sc
   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(Sc
 
   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

Modified: polly/trunk/lib/Support/VirtualInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/VirtualInstruction.cpp?rev=308982&r1=308981&r2=308982&view=diff
==============================================================================
--- polly/trunk/lib/Support/VirtualInstruction.cpp (original)
+++ polly/trunk/lib/Support/VirtualInstruction.cpp Tue Jul 25 09:25:37 2017
@@ -73,7 +73,7 @@ VirtualUse VirtualUse::create(Scop *S, S
   // 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);




More information about the llvm-commits mailing list