<div dir="ltr">Hello Michael,<div><br></div><div>The changes in ScopBuilder that we had planned are complete and as of now I am not working on it. You could proceed with your changes.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>Regards,<br><br></div>Utpal Bora<br></div><div>Ph.D. Scholar</div><div><span style="font-size:12.8px">Computer Science & Engineering</span><br></div></div><div>IIT Hyderabad<br></div><div><a href="http://utpalbora.com" target="_blank">http://utpalbora.com<br></a></div><div dir="ltr"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jun 27, 2016 at 6:40 PM, Michael Kruse <span dir="ltr"><<a href="mailto:llvm-commits@meinersbur.de" target="_blank">llvm-commits@meinersbur.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I previously mentioned that I would move ScopBuilder to its own file<br>
after this patch. Would it be OK now or are there currently other<br>
patches in the works that would make a rebase necessary?<br>
<br>
Michael<br>
<br>
<br>
<br>
2016-06-27 11:25 GMT+02:00 Johannes Doerfert via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>>:<br>
<div class="HOEnZb"><div class="h5">> Author: jdoerfert<br>
> Date: Mon Jun 27 04:25:40 2016<br>
> New Revision: 273855<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=273855&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=273855&view=rev</a><br>
> Log:<br>
> This patch updates memory management of ScopBuilder class.<br>
><br>
> 1. SCoP object is not owned by ScopBuilder. It just creates a SCoP and<br>
> hand over ownership through getScop() method.<br>
> 2. ScopInfoRegionPass owns the SCoP object for a given region.<br>
><br>
> Patch by Utpal Bora <<a href="mailto:cs14mtech11017@iith.ac.in">cs14mtech11017@iith.ac.in</a>><br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D20912" rel="noreferrer" target="_blank">http://reviews.llvm.org/D20912</a><br>
><br>
> Modified:<br>
> polly/trunk/include/polly/ScopInfo.h<br>
> polly/trunk/lib/Analysis/ScopInfo.cpp<br>
><br>
> Modified: polly/trunk/include/polly/ScopInfo.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=273855&r1=273854&r2=273855&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=273855&r1=273854&r2=273855&view=diff</a><br>
> ==============================================================================<br>
> --- polly/trunk/include/polly/ScopInfo.h (original)<br>
> +++ polly/trunk/include/polly/ScopInfo.h Mon Jun 27 04:25:40 2016<br>
> @@ -2288,9 +2288,6 @@ class ScopBuilder {<br>
> // The Scop<br>
> std::unique_ptr<Scop> scop;<br>
><br>
> - // Clear the context.<br>
> - void clear();<br>
> -<br>
> // Build the SCoP for Region @p R.<br>
> void buildScop(Region &R, AssumptionCache &AC);<br>
><br>
> @@ -2485,18 +2482,16 @@ public:<br>
> /// @brief Try to build the Polly IR of static control part on the current<br>
> /// SESE-Region.<br>
> ///<br>
> - /// @return If the current region is a valid for a static control part,<br>
> - /// return the Polly IR representing this static control part,<br>
> - /// return null otherwise.<br>
> - Scop *getScop() { return scop.get(); }<br>
> - const Scop *getScop() const { return scop.get(); }<br>
> + /// @return Give up the ownership of the scop object or static control part<br>
> + /// for the region<br>
> + std::unique_ptr<Scop> getScop() { return std::move(scop); }<br>
> };<br>
><br>
> /// @brief The legacy pass manager's analysis pass to compute scop information<br>
> /// for a region.<br>
> class ScopInfoRegionPass : public RegionPass {<br>
> - /// @brief The ScopBuilder pointer which is used to construct a Scop.<br>
> - std::unique_ptr<ScopBuilder> SI;<br>
> + /// @brief The Scop pointer which is used to construct a Scop.<br>
> + std::unique_ptr<Scop> S;<br>
><br>
> public:<br>
> static char ID; // Pass identification, replacement for typeid<br>
> @@ -2504,27 +2499,19 @@ public:<br>
> ScopInfoRegionPass() : RegionPass(ID) {}<br>
> ~ScopInfoRegionPass() {}<br>
><br>
> - /// @brief Build ScopBuilder object, which constructs Polly IR of static<br>
> - /// control part for the current SESE-Region.<br>
> + /// @brief Build Scop object, the Polly IR of static control<br>
> + /// part for the current SESE-Region.<br>
> ///<br>
> - /// @return Return Scop for the current Region.<br>
> - Scop *getScop() {<br>
> - if (SI)<br>
> - return SI.get()->getScop();<br>
> - else<br>
> - return nullptr;<br>
> - }<br>
> - const Scop *getScop() const {<br>
> - if (SI)<br>
> - return SI.get()->getScop();<br>
> - else<br>
> - return nullptr;<br>
> - }<br>
> + /// @return If the current region is a valid for a static control part,<br>
> + /// return the Polly IR representing this static control part,<br>
> + /// return null otherwise.<br>
> + Scop *getScop() { return S.get(); }<br>
> + const Scop *getScop() const { return S.get(); }<br>
><br>
> /// @brief Calculate the polyhedral scop information for a given Region.<br>
> bool runOnRegion(Region *R, RGPassManager &RGM) override;<br>
><br>
> - void releaseMemory() override { SI.reset(); }<br>
> + void releaseMemory() override { S.reset(); }<br>
><br>
> void print(raw_ostream &O, const Module *M = nullptr) const override;<br>
><br>
><br>
> Modified: polly/trunk/lib/Analysis/ScopInfo.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=273855&r1=273854&r2=273855&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=273855&r1=273854&r2=273855&view=diff</a><br>
> ==============================================================================<br>
> --- polly/trunk/lib/Analysis/ScopInfo.cpp (original)<br>
> +++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Jun 27 04:25:40 2016<br>
> @@ -4881,8 +4881,6 @@ ScopBuilder::ScopBuilder(Region *R, Assu<br>
> emitOptimizationRemarkAnalysis(F->getContext(), DEBUG_TYPE, *F, End, Msg);<br>
> }<br>
><br>
> -void ScopBuilder::clear() { scop.reset(); }<br>
> -<br>
> //===----------------------------------------------------------------------===//<br>
> void ScopInfoRegionPass::getAnalysisUsage(AnalysisUsage &AU) const {<br>
> AU.addRequired<LoopInfoWrapperPass>();<br>
> @@ -4909,19 +4907,16 @@ bool ScopInfoRegionPass::runOnRegion(Reg<br>
> auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();<br>
> auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(*F);<br>
><br>
> - SI.reset(new ScopBuilder(R, AC, AA, DL, DT, LI, SD, SE));<br>
> + ScopBuilder SB(R, AC, AA, DL, DT, LI, SD, SE);<br>
> + S = SB.getScop(); // take ownership of scop object<br>
> return false;<br>
> }<br>
><br>
> void ScopInfoRegionPass::print(raw_ostream &OS, const Module *) const {<br>
> - Scop *scop;<br>
> - if (SI) {<br>
> - if ((scop = SI->getScop())) {<br>
> - scop->print(OS);<br>
> - return;<br>
> - }<br>
> - }<br>
> - OS << "Invalid Scop!\n";<br>
> + if (S)<br>
> + S->print(OS);<br>
> + else<br>
> + OS << "Invalid Scop!\n";<br>
> }<br>
><br>
> char ScopInfoRegionPass::ID = 0;<br>
><br>
><br>
> _______________________________________________<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/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
You received this message because you are subscribed to the Google Groups "Polly Development" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:polly-dev%2Bunsubscribe@googlegroups.com">polly-dev+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" rel="noreferrer" target="_blank">https://groups.google.com/d/optout</a>.<br>
</font></span></blockquote></div><br></div>