<div dir="ltr">r287572<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 12:33 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you.<br>
<br>
Just one minor comment: It seems the "either" in the first comment line<br>
of each of the new functions is not needed anymore.<br>
<br>
Best,<br>
Tobias<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Nov 21, 2016, at 09:09 PM, Hongbin Zheng via llvm-commits wrote:<br>
> Author: ether<br>
> Date: Mon Nov 21 14:09:40 2016<br>
> New Revision: 287566<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=287566&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=287566&view=rev</a><br>
> Log:<br>
> Split ScopInfo::addScopStmt into two versions. NFC<br>
><br>
> One for adding statement for region, another one for BB<br>
><br>
> Modified:<br>
>     polly/trunk/include/polly/<wbr>ScopInfo.h<br>
>     polly/trunk/lib/Analysis/<wbr>ScopBuilder.cpp<br>
>     polly/trunk/lib/Analysis/<wbr>ScopInfo.cpp<br>
><br>
> Modified: polly/trunk/include/polly/<wbr>ScopInfo.h<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=287566&r1=287565&r2=287566&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/polly/trunk/include/<wbr>polly/ScopInfo.h?rev=287566&<wbr>r1=287565&r2=287566&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- polly/trunk/include/polly/<wbr>ScopInfo.h (original)<br>
> +++ polly/trunk/include/polly/<wbr>ScopInfo.h Mon Nov 21 14:09:40 2016<br>
> @@ -1858,14 +1858,21 @@ private:<br>
>    /// @return The representing SCEV for invariant loads or @p S if none.<br>
>    const SCEV *<wbr>getRepresentingInvariantLoadSC<wbr>EV(const SCEV *S);<br>
><br>
> -  /// Create a new SCoP statement for either @p BB or @p R.<br>
> +  /// Create a new SCoP statement for either @p BB.<br>
>    ///<br>
> -  /// Either @p BB or @p R should be non-null. A new statement for the<br>
> non-null<br>
> -  /// argument will be created and added to the statement vector and<br>
> map.<br>
> +  /// A new statement for @p BB will be created and added to the<br>
> statement vector<br>
> +  /// and map.<br>
>    ///<br>
> -  /// @param BB         The basic block we build the statement for (or<br>
> null)<br>
> -  /// @param R          The region we build the statement for (or null).<br>
> -  void addScopStmt(BasicBlock *BB, Region *R);<br>
> +  /// @param BB         The basic block we build the statement for.<br>
> +  void addScopStmt(BasicBlock *BB);<br>
> +<br>
> +  /// Create a new SCoP statement for either @p R.<br>
> +  ///<br>
> +  /// A new statement for @p R will be created and added to the<br>
> statement vector<br>
> +  /// and map.<br>
> +  ///<br>
> +  /// @param R          The region we build the statement for.<br>
> +  void addScopStmt(Region *R);<br>
><br>
>    /// @param Update access dimensionalities.<br>
>    ///<br>
><br>
> Modified: polly/trunk/lib/Analysis/<wbr>ScopBuilder.cpp<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=287566&r1=287565&r2=287566&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/polly/trunk/lib/<wbr>Analysis/ScopBuilder.cpp?rev=<wbr>287566&r1=287565&r2=287566&<wbr>view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- polly/trunk/lib/Analysis/<wbr>ScopBuilder.cpp (original)<br>
> +++ polly/trunk/lib/Analysis/<wbr>ScopBuilder.cpp Mon Nov 21 14:09:40 2016<br>
> @@ -430,7 +430,7 @@ void ScopBuilder::<wbr>buildAccessFunctions(R<br>
>  void ScopBuilder::buildStmts(Region &SR) {<br>
><br>
>    if (scop->isNonAffineSubRegion(&<wbr>SR)) {<br>
> -    scop->addScopStmt(nullptr, &SR);<br>
> +    scop->addScopStmt(&SR);<br>
>      return;<br>
>    }<br>
><br>
> @@ -438,7 +438,7 @@ void ScopBuilder::buildStmts(Region &SR)<br>
>      if (I->isSubRegion())<br>
>        buildStmts(*I->getNodeAs<<wbr>Region>());<br>
>      else<br>
> -      scop->addScopStmt(I-><wbr>getNodeAs<BasicBlock>(), nullptr);<br>
> +      scop->addScopStmt(I-><wbr>getNodeAs<BasicBlock>());<br>
>  }<br>
><br>
>  void ScopBuilder::<wbr>buildAccessFunctions(<wbr>BasicBlock &BB,<br>
><br>
> Modified: polly/trunk/lib/Analysis/<wbr>ScopInfo.cpp<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=287566&r1=287565&r2=287566&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/polly/trunk/lib/<wbr>Analysis/ScopInfo.cpp?rev=<wbr>287566&r1=287565&r2=287566&<wbr>view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- polly/trunk/lib/Analysis/<wbr>ScopInfo.cpp (original)<br>
> +++ polly/trunk/lib/Analysis/<wbr>ScopInfo.cpp Mon Nov 21 14:09:40 2016<br>
> @@ -4206,18 +4206,19 @@ mapToDimension(__isl_take isl_union_set<br>
>    return isl_multi_union_pw_aff_from_<wbr>union_pw_multi_aff(Data.Res);<br>
>  }<br>
><br>
> -void Scop::addScopStmt(BasicBlock *BB, Region *R) {<br>
> -  if (BB) {<br>
> -    Stmts.emplace_back(*this, *BB);<br>
> -    auto *Stmt = &Stmts.back();<br>
> +void Scop::addScopStmt(BasicBlock *BB) {<br>
> +  assert(BB && "Unexpected nullptr!");<br>
> +  Stmts.emplace_back(*this, *BB);<br>
> +  auto *Stmt = &Stmts.back();<br>
> +  StmtMap[BB] = Stmt;<br>
> +}<br>
> +<br>
> +void Scop::addScopStmt(Region *R) {<br>
> +  assert(R && "Unexpected nullptr!");<br>
> +  Stmts.emplace_back(*this, *R);<br>
> +  auto *Stmt = &Stmts.back();<br>
> +  for (BasicBlock *BB : R->blocks())<br>
>      StmtMap[BB] = Stmt;<br>
> -  } else {<br>
> -    assert(R && "Either basic block or a region expected.");<br>
> -    Stmts.emplace_back(*this, *R);<br>
> -    auto *Stmt = &Stmts.back();<br>
> -    for (BasicBlock *BB : R->blocks())<br>
> -      StmtMap[BB] = Stmt;<br>
> -  }<br>
>  }<br>
><br>
>  ScopStmt *Scop::addScopStmt(__isl_take isl_map *SourceRel,<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>