[llvm-commits] [polly] r144285 - in /polly/trunk: lib/Analysis/ScopDetection.cpp www/example_load_Polly_into_clang.html

Tobias Grosser grosser at fim.uni-passau.de
Thu Nov 10 04:47:26 PST 2011


Author: grosser
Date: Thu Nov 10 06:47:26 2011
New Revision: 144285

URL: http://llvm.org/viewvc/llvm-project?rev=144285&view=rev
Log:
ScopDetection: Add flag to ignore possible aliasing

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp
    polly/trunk/www/example_load_Polly_into_clang.html

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=144285&r1=144284&r2=144285&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Thu Nov 10 06:47:26 2011
@@ -74,6 +74,10 @@
              cl::value_desc("The function name to detect scops in"),
              cl::ValueRequired, cl::init(""));
 
+static cl::opt<bool>
+IgnoreAliasing("polly-ignore-aliasing",
+               cl::desc("Ignore possible aliasing of the array bases"),
+               cl::Hidden, cl::init(false));
 
 //===----------------------------------------------------------------------===//
 // Statistics.
@@ -241,7 +245,7 @@
   AliasSet &AS =
     Context.AST.getAliasSetForPointer(BaseValue, AliasAnalysis::UnknownSize,
                                       Inst.getMetadata(LLVMContext::MD_tbaa));
-  if (!AS.isMustAlias())
+  if (!AS.isMustAlias() && !IgnoreAliasing)
     INVALID(Alias, "Possible aliasing found for value: " << *BaseValue);
 
   return true;

Modified: polly/trunk/www/example_load_Polly_into_clang.html
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/www/example_load_Polly_into_clang.html?rev=144285&r1=144284&r2=144285&view=diff
==============================================================================
--- polly/trunk/www/example_load_Polly_into_clang.html (original)
+++ polly/trunk/www/example_load_Polly_into_clang.html Thu Nov 10 06:47:26 2011
@@ -91,6 +91,14 @@
 By default both optimizers perform tiling, if possible. In case this is not
 wanted the option '-polly-no-tiling' can be used to disable it. (This option
 works for both optimizers).
+
+<h3>Ignore possible aliasing</h3>
+By default we only detect scops, if we can prove that the different array bases
+can not alias. This is the correct thing to do if optimizing automatically.
+However, this may yield to a low scop coverage as without special user
+annotations like 'restrict' the absence of aliasing can often not be proven.
+When optimizing code where we know no aliasing can happen, we may want to remove
+this restriction.
 </div>
 </body>
 </html>





More information about the llvm-commits mailing list