[polly] r183114 - scop detection: do not call getAliasSetForPointer when IgnoreAliasing

Sebastian Pop spop at codeaurora.org
Mon Jun 3 09:35:41 PDT 2013


Author: spop
Date: Mon Jun  3 11:35:41 2013
New Revision: 183114

URL: http://llvm.org/viewvc/llvm-project?rev=183114&view=rev
Log:
scop detection: do not call getAliasSetForPointer when IgnoreAliasing

Contributed-by: Dmitry N. Mikushin <maemarcus at gmail.com>

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=183114&r1=183113&r2=183114&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Mon Jun  3 11:35:41 2013
@@ -275,51 +275,52 @@ bool ScopDetection::isValidMemoryAccess(
   if (isa<IntToPtrInst>(BaseValue))
     INVALID(Other, "Find bad intToptr prt: " << *BaseValue);
 
-  // Check if the base pointer of the memory access does alias with
-  // any other pointer. This cannot be handled at the moment.
-  AliasSet &AS =
-      Context.AST.getAliasSetForPointer(BaseValue, AliasAnalysis::UnknownSize,
-                                        Inst.getMetadata(LLVMContext::MD_tbaa));
-
-  // INVALID triggers an assertion in verifying mode, if it detects that a SCoP
-  // was detected by SCoP detection and that this SCoP was invalidated by a pass
-  // that stated it would preserve the SCoPs.
-  // We disable this check as the independent blocks pass may create memory
-  // references which seem to alias, if -basicaa is not available. They actually
-  // do not, but as we can not proof this without -basicaa we would fail. We
-  // disable this check to not cause irrelevant verification failures.
-  if (!AS.isMustAlias() && !IgnoreAliasing) {
-    std::string Message;
-    raw_string_ostream OS(Message);
-
-    OS << "Possible aliasing: ";
-
-    std::vector<Value *> Pointers;
-
-    for (AliasSet::iterator AI = AS.begin(), AE = AS.end(); AI != AE; ++AI)
-      Pointers.push_back(AI.getPointer());
-
-    std::sort(Pointers.begin(), Pointers.end());
-
-    for (std::vector<Value *>::iterator PI = Pointers.begin(),
-                                        PE = Pointers.end();
-         ;) {
-      Value *V = *PI;
-
-      if (V->getName().size() == 0)
-        OS << "\"" << *V << "\"";
-      else
-        OS << "\"" << V->getName() << "\"";
-
-      ++PI;
-
-      if (PI != PE)
-        OS << ", ";
-      else
-        break;
-    }
+  if (!IgnoreAliasing) {
+    // Check if the base pointer of the memory access does alias with
+    // any other pointer. This cannot be handled at the moment.
+    AliasSet &AS =
+        Context.AST.getAliasSetForPointer(BaseValue, AliasAnalysis::UnknownSize,
+                                          Inst.getMetadata(LLVMContext::MD_tbaa));
+
+    // INVALID triggers an assertion in verifying mode, if it detects that a SCoP
+    // was detected by SCoP detection and that this SCoP was invalidated by a pass
+    // that stated it would preserve the SCoPs.
+    // We disable this check as the independent blocks pass may create memory
+    // references which seem to alias, if -basicaa is not available. They actually
+    // do not, but as we can not proof this without -basicaa we would fail. We
+    // disable this check to not cause irrelevant verification failures.
+    if (!AS.isMustAlias()) {
+      std::string Message;
+      raw_string_ostream OS(Message);
+
+      OS << "Possible aliasing: ";
+
+      std::vector<Value *> Pointers;
+
+      for (AliasSet::iterator AI = AS.begin(), AE = AS.end(); AI != AE; ++AI)
+        Pointers.push_back(AI.getPointer());
+
+      std::sort(Pointers.begin(), Pointers.end());
+
+      for (std::vector<Value *>::iterator PI = Pointers.begin(),
+          PE = Pointers.end(); ;) {
+        Value *V = *PI;
+
+        if (V->getName().size() == 0)
+          OS << "\"" << *V << "\"";
+        else
+          OS << "\"" << V->getName() << "\"";
+
+        ++PI;
+
+        if (PI != PE)
+          OS << ", ";
+        else
+          break;
+      }
 
-    INVALID_NOVERIFY(Alias, OS.str());
+      INVALID_NOVERIFY(Alias, OS.str());
+    }
   }
 
   return true;





More information about the llvm-commits mailing list