[llvm-commits] [llvm] r59940 - in /llvm/trunk: docs/LangRef.html lib/Analysis/BasicAliasAnalysis.cpp

Nick Lewycky nicholas at mxc.ca
Sun Nov 23 21:00:44 PST 2008


Author: nicholas
Date: Sun Nov 23 23:00:44 2008
New Revision: 59940

URL: http://llvm.org/viewvc/llvm-project?rev=59940&view=rev
Log:
Seriously strengthen the guarantee offered by noalias on a function's return
value. It must now be as if the pointer were allocated and has not escaped to
the caller. Thanks to Dan Gohman for pointing out the error in the original
and helping devise this definition.

Modified:
    llvm/trunk/docs/LangRef.html
    llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp

Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=59940&r1=59939&r2=59940&view=diff

==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Sun Nov 23 23:00:44 2008
@@ -892,9 +892,9 @@
     <dt><tt>noalias</tt></dt>
     <dd>This indicates that the pointer does not alias any global or any other
     parameter.  The caller is responsible for ensuring that this is the
-    case. Additionally, on a function return value <tt>noalias</tt> indicates
-    that the pointer does not alias the return value from other calls of
-    itself or other noalias functions.</dd>
+    case. On a function return value, <tt>noalias</tt> additionally indicates
+    that the pointer does not alias any other pointers visible to the
+    caller.</dd>
 
     <dt><tt>nest</tt></dt>
     <dd>This indicates that the pointer parameter can be excised using the

Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=59940&r1=59939&r2=59940&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Sun Nov 23 23:00:44 2008
@@ -383,9 +383,9 @@
     if (isIdentifiedObject(O1) && isIdentifiedObject(O2))
       return NoAlias;
   
-    // Local allocations can't alias with arguments or noalias functions.
-    if ((isa<AllocationInst>(O1) && (isa<Argument>(O2) || isNoAliasCall(O2))) ||
-        (isa<AllocationInst>(O2) && (isa<Argument>(O1) || isNoAliasCall(O1))))
+    // Arguments can't alias with local allocations or noalias calls.
+    if ((isa<Argument>(O1) && (isa<AllocationInst>(O2) || isNoAliasCall(O2))) ||
+        (isa<Argument>(O2) && (isa<AllocationInst>(O1) || isNoAliasCall(O1))))
       return NoAlias;
 
     // Most objects can't alias null.





More information about the llvm-commits mailing list