[polly] r328666 - [polly] [ScopInfo] Don't pre-compute the name of the Scop's region.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 13:51:49 PDT 2018


Author: efriedma
Date: Tue Mar 27 13:51:49 2018
New Revision: 328666

URL: http://llvm.org/viewvc/llvm-project?rev=328666&view=rev
Log:
[polly] [ScopInfo] Don't pre-compute the name of the Scop's region.

This gets very expensive for basic blocks which don't have a name: it
calls printAsOperand, which numbers the entire module. We don't
normally need the name anyway, though; it's only used for debug dumps,
so don't compute it by default.

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


Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=328666&r1=328665&r2=328666&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Tue Mar 27 13:51:49 2018
@@ -1709,9 +1709,6 @@ private:
   /// The underlying Region.
   Region &R;
 
-  /// The name of the SCoP (identical to the regions name)
-  std::string name;
-
   /// The ID to be assigned to the next Scop in a function
   static int NextScopID;
 
@@ -2442,7 +2439,7 @@ public:
   /// could be executed.
   bool isEmpty() const { return Stmts.empty(); }
 
-  const StringRef getName() const { return name; }
+  const StringRef getName() const { return R.getNameStr(); }
 
   using array_iterator = ArrayInfoSetTy::iterator;
   using const_array_iterator = ArrayInfoSetTy::const_iterator;

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=328666&r1=328665&r2=328666&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Mar 27 13:51:49 2018
@@ -3327,8 +3327,8 @@ Scop::Scop(Region &R, ScalarEvolution &S
            DominatorTree &DT, ScopDetection::DetectionContext &DC,
            OptimizationRemarkEmitter &ORE)
     : IslCtx(isl_ctx_alloc(), isl_ctx_free), SE(&ScalarEvolution), DT(&DT),
-      R(R), name(R.getNameStr()), HasSingleExitEdge(R.getExitingBlock()),
-      DC(DC), ORE(ORE), Affinator(this, LI),
+      R(R), HasSingleExitEdge(R.getExitingBlock()), DC(DC), ORE(ORE),
+      Affinator(this, LI),
       ID(getNextID((*R.getEntry()->getParent()).getName().str())) {
   if (IslOnErrorAbort)
     isl_options_set_on_error(getIslCtx().get(), ISL_ON_ERROR_ABORT);




More information about the llvm-commits mailing list