<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi <span style="white-space: pre-wrap; line-height: 1.7;">Sebastian,</span><br><br>I agree with you that we should add a flag to incrementally optimize the<div> scope detection pass. <span style="line-height: 1.7;">Attached is the patch file for this purpose.</span></div><div><div><br></div><div><span style="line-height: 1.7;">I will investigate more on the scop detection pass. I think all optimizations</span></div><div><span style="line-height: 1.7;">for this </span><span style="line-height: 1.7;">pass </span><span style="line-height: 1.7;">can be controlled by the same flag "-polly-fast-detection".</span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">Best wishes,</span></div><div>Star Tan</div><div><pre><br>At 2013-05-30 00:58:50,"Sebastian Pop" <spop@codeaurora.org> wrote:
>Hi,
>
>when compiling c++ code (or c code with a lot of functions), scop detection
>shows a huge overhead: probably 1/3 of the compile time is spent in scop
>detection trying to find out maximal regions in functions with no loops.
>
>Here is a preliminary patch (does not fix the testsuite) that disables scop
>detection on functions with no loops:
>
>diff --git a/lib/Analysis/ScopDetection.cpp b/lib/Analysis/ScopDetection.cpp
>index ab323fd..ee2721d 100644
>--- a/lib/Analysis/ScopDetection.cpp
>+++ b/lib/Analysis/ScopDetection.cpp
>@@ -785,9 +785,12 @@ void
>ScopDetection::printInvalidLocations(llvm::Function &F) {
>
> }
> bool ScopDetection::runOnFunction(llvm::Function &F) {
>+  LI = &getAnalysisID<LoopInfo>(LoopInfo::getClassPassID());
>+  if (LI->empty())
>+    return false;
>+
>   AA = &getAnalysisID<AliasAnalysis>(AliasAnalysis::getClassPassID());
>   SE = &getAnalysisID<ScalarEvolution>(ScalarEvolution::getClassPassID());
>-  LI = &getAnalysisID<LoopInfo>(LoopInfo::getClassPassID());
>   RI = &getAnalysisID<RegionInfo>(RegionInfo::getClassPassID());
>   Region *TopRegion = RI->getTopLevelRegion();
>
>
>My question is how do you want to fix the testsuite? Do you want to remove or
>rewrite the files that check for patterns in functions with no loops, or do you
>want to add a flag to enable scop detection even with no loops in a function?
>
>I would prefer the flag solution: it's the easiest way for me to fix
>the testsuite.
>
>Thanks,
>Sebastian
>--
>Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
>hosted by The Linux Foundation
</pre></div></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"><span title="neteasefooter"><span id="netease_mail_footer"><a href="#" target="_blank"></a></span></span>
</span></span>