[polly] r286771 - [ScopDetect] Conservatively handle inaccessible memory alias attributes

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 11:27:24 PST 2016


Author: grosser
Date: Sun Nov 13 13:27:24 2016
New Revision: 286771

URL: http://llvm.org/viewvc/llvm-project?rev=286771&view=rev
Log:
[ScopDetect] Conservatively handle inaccessible memory alias attributes

Commit r286294 introduced support for inaccessiblememonly and
inaccessiblemem_or_argmemonly attributes to BasicAA, which we need to
support to avoid undefined behavior. This change just refuses all calls
which are annotated with these attributes, which is conservatively correct.
In the future we may consider to model and support such function calls
in Polly.

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

Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=286771&r1=286770&r2=286771&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Sun Nov 13 13:27:24 2016
@@ -322,6 +322,8 @@ bool ScopBuilder::buildAccessCallInst(Me
   case llvm::FMRB_DoesNotAccessMemory:
     return true;
   case llvm::FMRB_DoesNotReadMemory:
+  case llvm::FMRB_OnlyAccessesInaccessibleMem:
+  case llvm::FMRB_OnlyAccessesInaccessibleOrArgMem:
     return false;
   case llvm::FMRB_OnlyReadsMemory:
     GlobalReads.push_back(CI);

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=286771&r1=286770&r2=286771&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sun Nov 13 13:27:24 2016
@@ -491,6 +491,8 @@ bool ScopDetection::isValidCallInst(Call
       Context.AST.add(&CI);
       return true;
     case FMRB_DoesNotReadMemory:
+    case FMRB_OnlyAccessesInaccessibleMem:
+    case FMRB_OnlyAccessesInaccessibleOrArgMem:
       return false;
     }
   }




More information about the llvm-commits mailing list