[polly] r259501 - Remove helper function [NFC]

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 06:24:58 PST 2016


2016-02-02 15:14 GMT+01:00 Johannes Doerfert via llvm-commits <
llvm-commits at lists.llvm.org>:

> Author: jdoerfert
> Date: Tue Feb  2 08:14:40 2016
> New Revision: 259501
>
> URL: http://llvm.org/viewvc/llvm-project?rev=259501&view=rev
> Log:
> Remove helper function [NFC]
>
> 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=259501&r1=259500&r2=259501&view=diff
>
> ==============================================================================
> --- polly/trunk/include/polly/ScopInfo.h (original)
> +++ polly/trunk/include/polly/ScopInfo.h Tue Feb  2 08:14:40 2016
> @@ -1921,13 +1921,6 @@ class ScopInfo : public RegionPass {
>    Scop *scop;
>    isl_ctx *ctx;
>
> -  /// @brief Return the SCoP region that is currently processed.
> -  Region *getRegion() const {
> -    if (!scop)
> -      return nullptr;
> -    return &scop->getRegion();
> -  }
> -
>    // Clear the context.
>    void clear();
>
> @@ -1974,9 +1967,12 @@ class ScopInfo : public RegionPass {
>
>    /// @brief Create ScopStmt for all BBs and non-affine subregions of @p
> SR.
>    ///
> +  /// @param R  The SCoP region.
> +  /// @param SR A subregion of @p R.
> +  ///
>    /// Some of the statments might be optimized away later when they do not
>    /// access any memory and thus have no effect.
> -  void buildStmts(Region &SR);
> +  void buildStmts(Region &R, Region &SR);\\\
>
>    /// @brief Build the access functions for the basic block @p BB
>    ///
>
> Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=259501&r1=259500&r2=259501&view=diff
>
> ==============================================================================
> --- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
> +++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Feb  2 08:14:40 2016
> @@ -3876,17 +3876,16 @@ void ScopInfo::buildAccessFunctions(Regi
>        buildAccessFunctions(R, *I->getNodeAs<BasicBlock>());
>  }
>
> -void ScopInfo::buildStmts(Region &SR) {
> -  Region *R = getRegion();
> +void ScopInfo::buildStmts(Region &R, Region &SR) {
>

Why? IMHO this makes it more confusing, as if buildStmts could operate on
more than one Region. If it's for the sake of removing the helper function,
you could directly use scop->getRegion() instead.


> -  if (SD->isNonAffineSubRegion(&SR, R)) {
> +  if (SD->isNonAffineSubRegion(&SR, &R)) {
>      scop->addScopStmt(nullptr, &SR);
>      return;
>    }
>
>    for (auto I = SR.element_begin(), E = SR.element_end(); I != E; ++I)
>      if (I->isSubRegion())
> -      buildStmts(*I->getNodeAs<Region>());
> +      buildStmts(R, *I->getNodeAs<Region>());
>      else
>        scop->addScopStmt(I->getNodeAs<BasicBlock>(), nullptr);
>  }
> @@ -4067,7 +4066,7 @@ void ScopInfo::buildScop(Region &R, Assu
>    unsigned MaxLoopDepth = getMaxLoopDepthInRegion(R, *LI, *SD);
>    scop = new Scop(R, AccFuncMap, *SD, *SE, *DT, *LI, ctx, MaxLoopDepth);
>
> -  buildStmts(R);
> +  buildStmts(R, R);
>    buildAccessFunctions(R, R);
>
>    // In case the region does not have an exiting block we will later
> (during
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160202/a35190ca/attachment.html>


More information about the llvm-commits mailing list