[llvm-commits] [llvm] r40635 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll

Christopher Lamb christopher.lamb at gmail.com
Tue Jul 31 09:18:07 PDT 2007


Author: clamb
Date: Tue Jul 31 11:18:07 2007
New Revision: 40635

URL: http://llvm.org/viewvc/llvm-project?rev=40635&view=rev
Log:
Revert overly aggressive interpretation of noalias

Removed:
    llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
Modified:
    llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp

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

==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Jul 31 11:18:07 2007
@@ -18,7 +18,6 @@
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Function.h"
-#include "llvm/ParameterAttributes.h"
 #include "llvm/GlobalVariable.h"
 #include "llvm/Instructions.h"
 #include "llvm/Pass.h"
@@ -295,21 +294,6 @@
 
   // Pointing at a discernible object?
   if (O1) {
-    // Check for noalias attribute
-    if (isa<Argument>(O1)) {
-      const Argument *Arg = cast<Argument>(O1);
-      const Function *Func = Arg->getParent();
-      const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs();
-      if (Attr) {
-        unsigned Idx = 1;
-        for (Function::const_arg_iterator I = Func->arg_begin(), 
-              E = Func->arg_end(); I != E; ++I, ++Idx) {
-          if (&(*I) == Arg && 
-               Attr->paramHasAttr(Idx, ParamAttr::NoAlias))
-            return NoAlias;
-        }
-      }
-    }
     if (O2) {
       if (isa<Argument>(O1)) {
         // Incoming argument cannot alias locally allocated object!
@@ -323,22 +307,7 @@
         // If they are two different objects, we know that we have no alias...
         return NoAlias;
       }
-      
-      // Check for noalias atrribute independently from above logic
-      if (isa<Argument>(O2)) {
-        const Argument *Arg = cast<Argument>(O2);
-        const Function *Func = Arg->getParent();
-        const ParamAttrsList *Attr = Func->getFunctionType()->getParamAttrs();
-        if (Attr) {
-          unsigned Idx = 1;
-          for (Function::const_arg_iterator I = Func->arg_begin(), 
-                E = Func->arg_end(); I != E; ++I, ++Idx) {
-            if (&(*I) == Arg && 
-                 Attr->paramHasAttr(Idx, ParamAttr::NoAlias))
-              return NoAlias;
-          }
-        }
-      }
+
       // If they are the same object, they we can look at the indexes.  If they
       // index off of the object is the same for both pointers, they must alias.
       // If they are provably different, they must not alias.  Otherwise, we

Removed: llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll?rev=40634&view=auto

==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2007-07-31-NoAliasTest.ll (removed)
@@ -1,12 +0,0 @@
-; RUN:   llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep '1 may alias'
-; RUN:   llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep '5 no alias'
-; RUN:   llvm-as %s -o - | opt -aa-eval -print-may-aliases -disable-output |& grep 'MayAlias:     i32* %ptr4, i32* %ptr2'
-
-define void @_Z3fooPiS_RiS_(i32* noalias  %ptr1, i32* %ptr2, i32* noalias  %ptr3, i32* %ptr4) {
-entry:
-        store i32 0, i32* %ptr1
-        store i32 0, i32* %ptr2
-        store i32 0, i32* %ptr3
-        store i32 0, i32* %ptr4
-        ret void
-}
\ No newline at end of file





More information about the llvm-commits mailing list