[polly] speedup compile time for functions with no loops

Star Tan tanmx_star at yeah.net
Thu May 30 08:27:19 PDT 2013


Hi Sebastian,

I agree with you that we should add a flag to incrementally optimize the
 scope detection pass. Attached is the patch file for this purpose.


I will investigate more on the scop detection pass. I think all optimizations
for this pass can be controlled by the same flag "-polly-fast-detection".


Best wishes,
Star Tan

At 2013-05-30 00:58:50,"Sebastian Pop" <spop at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130530/eabe470b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ScopDetection-Add-option-polly-fast-detection.patch
Type: application/octet-stream
Size: 1719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130530/eabe470b/attachment.obj>


More information about the llvm-commits mailing list