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

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 20:55:16 PDT 2018


Very useful!

Best,
Tobias

On Tue, Mar 27, 2018, at 21:19, Eli Friedman via Phabricator wrote:
> efriedma created this revision.
> efriedma added reviewers: Meinersbur, grosser.
> Herald added a reviewer: bollu.
> 
> 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, so don't compute it by default.
> 
> 
> Repository:
>   rPLO Polly
> 
> https://reviews.llvm.org/D44946
> 
> Files:
>   include/polly/ScopInfo.h
>   lib/Analysis/ScopInfo.cpp
> 
> 
> Index: lib/Analysis/ScopInfo.cpp
> ===================================================================
> --- lib/Analysis/ScopInfo.cpp
> +++ lib/Analysis/ScopInfo.cpp
> @@ -3327,8 +3327,8 @@
>             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);
> Index: include/polly/ScopInfo.h
> ===================================================================
> --- include/polly/ScopInfo.h
> +++ include/polly/ScopInfo.h
> @@ -1709,9 +1709,6 @@
>    /// 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 @@
>    /// 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;
> 
> 
> Email had 1 attachment:
> + D44946.139973.patch
>   2k (text/x-patch)


More information about the llvm-commits mailing list