[polly] r308610 - [ScopBuilder] Avoid use of getStmtFor(BB). NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 05:47:09 PDT 2017


Author: meinersbur
Date: Thu Jul 20 05:47:09 2017
New Revision: 308610

URL: http://llvm.org/viewvc/llvm-project?rev=308610&view=rev
Log:
[ScopBuilder] Avoid use of getStmtFor(BB). NFC.

Since there will be no more a 1:1 correspondence between statements
and basic blocks, we would like to get rid of the method getStmtFor(BB)
and its uses. Here we remove one of its uses in ScopBuilder by fetching
the statement in which the instruction lies.

Contributed-by: Nandini Singhal <cs15mtech01004 at iith.ac.in>

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

Modified:
    polly/trunk/lib/Analysis/ScopBuilder.cpp

Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=308610&r1=308609&r2=308610&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Thu Jul 20 05:47:09 2017
@@ -880,11 +880,11 @@ static void verifyUse(Scop *S, Use &Op,
 /// happened yet, such that virtual and physical uses are equivalent.
 static void verifyUses(Scop *S, LoopInfo &LI, DominatorTree &DT) {
   for (auto *BB : S->getRegion().blocks()) {
-    auto *Stmt = S->getStmtFor(BB);
-    if (!Stmt)
-      continue;
-
     for (auto &Inst : *BB) {
+      auto *Stmt = S->getStmtFor(&Inst);
+      if (!Stmt)
+        continue;
+
       if (isIgnoredIntrinsic(&Inst))
         continue;
 




More information about the llvm-commits mailing list