[llvm-commits] [poolalloc] r168890 - in /poolalloc/branches/release_32: ./ lib/AssistDS/GEPExprArgs.cpp lib/AssistDS/LoadArgs.cpp lib/AssistDS/StructReturnToPointer.cpp lib/AssistDS/TypeChecks.cpp lib/DSA/Local.cpp lib/DSA/StdLibPass.cpp lib/DSA/TopDownClosure.cpp test/dsa/regression/2012-11-19.ExternFuncSummaries.ll test/dsa/regression/2012-11-19.MultipleVAStartAlias.ll test/dsa/regression/2012-11-20.TDUnresolvedIncomplete.ll test/dsa/td/basic-global.ll

John Criswell criswell at uiuc.edu
Thu Nov 29 07:37:35 PST 2012


Author: criswell
Date: Thu Nov 29 09:37:35 2012
New Revision: 168890

URL: http://llvm.org/viewvc/llvm-project?rev=168890&view=rev
Log:
Merged mainline poolalloc (revisions 167709 through r168889) to include bug
fixes and to fix compilation with the LLVM 3.2 release branch.

Added:
    poolalloc/branches/release_32/test/dsa/regression/2012-11-19.ExternFuncSummaries.ll
      - copied unchanged from r168889, poolalloc/trunk/test/dsa/regression/2012-11-19.ExternFuncSummaries.ll
    poolalloc/branches/release_32/test/dsa/regression/2012-11-19.MultipleVAStartAlias.ll
      - copied unchanged from r168889, poolalloc/trunk/test/dsa/regression/2012-11-19.MultipleVAStartAlias.ll
    poolalloc/branches/release_32/test/dsa/regression/2012-11-20.TDUnresolvedIncomplete.ll
      - copied unchanged from r168889, poolalloc/trunk/test/dsa/regression/2012-11-20.TDUnresolvedIncomplete.ll
    poolalloc/branches/release_32/test/dsa/td/basic-global.ll
      - copied unchanged from r168889, poolalloc/trunk/test/dsa/td/basic-global.ll
Modified:
    poolalloc/branches/release_32/   (props changed)
    poolalloc/branches/release_32/lib/AssistDS/GEPExprArgs.cpp
    poolalloc/branches/release_32/lib/AssistDS/LoadArgs.cpp
    poolalloc/branches/release_32/lib/AssistDS/StructReturnToPointer.cpp
    poolalloc/branches/release_32/lib/AssistDS/TypeChecks.cpp
    poolalloc/branches/release_32/lib/DSA/Local.cpp
    poolalloc/branches/release_32/lib/DSA/StdLibPass.cpp
    poolalloc/branches/release_32/lib/DSA/TopDownClosure.cpp

Propchange: poolalloc/branches/release_32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 29 09:37:35 2012
@@ -1,2 +1,3 @@
 /poolalloc/branches/release_26:97820-104253
 /poolalloc/branches/release_30:161126-166575
+/poolalloc/trunk:167709-168889

Modified: poolalloc/branches/release_32/lib/AssistDS/GEPExprArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/AssistDS/GEPExprArgs.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/AssistDS/GEPExprArgs.cpp (original)
+++ poolalloc/branches/release_32/lib/AssistDS/GEPExprArgs.cpp Thu Nov 29 09:37:35 2012
@@ -174,7 +174,8 @@
           if (FnAttrs.hasAttributes())
             AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-          AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+          AttrListPtr NewCallPAL = AttrListPtr::get(F->getContext(),
+                                                    AttributesVec);
 
           CallInst *CallI = CallInst::Create(NewF,Args,"", CI);
           CallI->setCallingConv(CI->getCallingConv());

Modified: poolalloc/branches/release_32/lib/AssistDS/LoadArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/AssistDS/LoadArgs.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/AssistDS/LoadArgs.cpp (original)
+++ poolalloc/branches/release_32/lib/AssistDS/LoadArgs.cpp Thu Nov 29 09:37:35 2012
@@ -201,7 +201,8 @@
           if (FnAttrs.hasAttributes())
             AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-          AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+          AttrListPtr NewCallPAL = AttrListPtr::get(F->getContext(),
+                                                    AttributesVec);
 
           CallInst *CallI = CallInst::Create(NewF,Args,"", CI);
           CallI->setCallingConv(CI->getCallingConv());

Modified: poolalloc/branches/release_32/lib/AssistDS/StructReturnToPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/AssistDS/StructReturnToPointer.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/AssistDS/StructReturnToPointer.cpp (original)
+++ poolalloc/branches/release_32/lib/AssistDS/StructReturnToPointer.cpp Thu Nov 29 09:37:35 2012
@@ -142,7 +142,8 @@
       if (FnAttrs.hasAttributes())
         AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-      AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+      AttrListPtr NewCallPAL = AttrListPtr::get(F->getContext(),
+                                                AttributesVec);
 
       CallInst *CallI = CallInst::Create(NF, Args, "", CI);
       CallI->setCallingConv(CI->getCallingConv());

Modified: poolalloc/branches/release_32/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/AssistDS/TypeChecks.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/branches/release_32/lib/AssistDS/TypeChecks.cpp Thu Nov 29 09:37:35 2012
@@ -1086,7 +1086,8 @@
         if (FnAttrs.hasAttributes())
           AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-        AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+        AttrListPtr NewCallPAL = AttrListPtr::get(F.getContext(),
+                                                  AttributesVec);
 
 
         // Create the substitute call
@@ -1134,7 +1135,8 @@
         if (FnAttrs.hasAttributes())
           AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-        AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+        AttrListPtr NewCallPAL = AttrListPtr::get(F.getContext(),
+                                                  AttributesVec);
 
         // Create the substitute call
         CallInst *CallI = CallInst::Create(&F,

Modified: poolalloc/branches/release_32/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/DSA/Local.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/DSA/Local.cpp (original)
+++ poolalloc/branches/release_32/lib/DSA/Local.cpp Thu Nov 29 09:37:35 2012
@@ -75,6 +75,7 @@
     Function* FB;
     LocalDataStructures* DS;
     const DataLayout& TD;
+    DSNode *VAArray;
 
     ////////////////////////////////////////////////////////////////////////////
     // Helper functions used to implement the visitation functions...
@@ -143,7 +144,7 @@
 
   public:
     GraphBuilder(Function &f, DSGraph &g, LocalDataStructures& DSi)
-      : G(g), FB(&f), DS(&DSi), TD(g.getDataLayout()) {
+      : G(g), FB(&f), DS(&DSi), TD(g.getDataLayout()), VAArray(0) {
       // Create scalar nodes for all pointer arguments...
       for (Function::arg_iterator I = f.arg_begin(), E = f.arg_end();
            I != E; ++I) {
@@ -205,7 +206,7 @@
 
     // GraphBuilder ctor for working on the globals graph
     explicit GraphBuilder(DSGraph& g)
-      :G(g), FB(0), TD(g.getDataLayout())
+      :G(g), FB(0), TD(g.getDataLayout()), VAArray(0)
     {}
 
     void mergeInGlobalInitializer(GlobalVariable *GV);
@@ -852,7 +853,7 @@
   // And assosiate the right node with the VANode for this function
   // so it can be merged with the right arguments from callsites
 
-  DSNodeHandle RetNH = getValueDest(*CS.arg_begin());
+  DSNodeHandle RetNH = getValueDest(CS.getArgument(0));
 
   if (DSNode *N = RetNH.getNode())
     visitVAStartNode(N);
@@ -872,7 +873,9 @@
   if (VANH.isNull()) VANH.mergeWith(createNode());
 
   // Create a dsnode for an array of pointers to the VAInfo for this func
-  DSNode * VAArray = createNode();
+  // We create one such array for each function analyzed, as all
+  // calls to va_start will populate their argument with the same data.
+  if (!VAArray) VAArray = createNode();
   VAArray->setArrayMarker();
   VAArray->foldNodeCompletely();
   VAArray->setLink(0,VANH);
@@ -900,6 +903,7 @@
       N->growSize(24); //sizeof the va_list struct mentioned above
     N->setLink(8,VAArray); //first i8*
     N->setLink(16,VAArray); //second i8*
+
     break;
   default:
     // FIXME: For now we abort if we don't know how to handle this arch
@@ -971,19 +975,21 @@
       ->foldNodeCompletely();
     return true;
   case Intrinsic::vaend:
+    // TODO: What to do here?
+    return true;
   case Intrinsic::memcpy: 
   case Intrinsic::memmove: {
     // Merge the first & second arguments, and mark the memory read and
     // modified.
-    DSNodeHandle RetNH = getValueDest(*CS.arg_begin());
-    RetNH.mergeWith(getValueDest(*(CS.arg_begin()+1)));
+    DSNodeHandle RetNH = getValueDest(CS.getArgument(0));
+    RetNH.mergeWith(getValueDest(CS.getArgument(1)));
     if (DSNode *N = RetNH.getNode())
       N->setModifiedMarker()->setReadMarker();
     return true;
   }
   case Intrinsic::memset:
     // Mark the memory modified.
-    if (DSNode *N = getValueDest(*CS.arg_begin()).getNode())
+    if (DSNode *N = getValueDest(CS.getArgument(0)).getNode())
       N->setModifiedMarker();
     return true;
 
@@ -1013,7 +1019,7 @@
 #endif
 
   case Intrinsic::eh_typeid_for: {
-    DSNodeHandle Ptr = getValueDest(*CS.arg_begin());
+    DSNodeHandle Ptr = getValueDest(CS.getArgument(0));
     Ptr.getNode()->setReadMarker();
     Ptr.getNode()->setIncompleteMarker();
     return true;
@@ -1125,7 +1131,7 @@
            "Too many arguments/incorrect function signature!");
 
   std::vector<DSNodeHandle> Args;
-  Args.reserve(CS.arg_end()-CS.arg_begin());
+  Args.reserve(CS.arg_size());
   DSNodeHandle VarArgNH;
 
   // Calculate the arguments vector...

Modified: poolalloc/branches/release_32/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/DSA/StdLibPass.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/branches/release_32/lib/DSA/StdLibPass.cpp Thu Nov 29 09:37:35 2012
@@ -418,6 +418,8 @@
   {"_ZNSolsEPFRSoS_E", {NRET_YARGS, NRET_YNARGS, NRET_NARGS, NRET_NARGS, false}},
   //endl
   {"_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_", {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
+  // Added by Jingyue
+  {"strtoll",       {NRET_YARGS, NRET_NYARGS, NRET_NYARGS, NRET_YARGS, false}},
   // Terminate the list of special functions recognized by this pass
   {0,            {NRET_NARGS, NRET_NARGS, NRET_NARGS, NRET_NARGS, false}},
 };
@@ -703,11 +705,11 @@
         for (unsigned y = 0; y < CI->getNumArgOperands(); ++y)
           if (isa<PointerType>(CI->getArgOperand(y)->getType())){
             if (Graph->hasNodeForValue(CI->getArgOperand(y))){
-              if (recFuncs[x].action.read[y])
+              if (recFuncs[x].action.read[y + 1])
                 Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setReadMarker();
-              if (recFuncs[x].action.write[y])
+              if (recFuncs[x].action.write[y + 1])
                 Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setModifiedMarker();
-              if (recFuncs[x].action.heap[y])
+              if (recFuncs[x].action.heap[y + 1])
                 Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setHeapMarker();
             }
           }
@@ -722,7 +724,7 @@
             if (Graph->hasNodeForValue(CI))
               toMerge.push_back(Graph->getNodeForValue(CI));
         for (unsigned y = 0; y < CI->getNumArgOperands(); ++y)
-          if (recFuncs[x].action.mergeNodes[y])
+          if (recFuncs[x].action.mergeNodes[y + 1])
             if (isa<PointerType>(CI->getArgOperand(y)->getType()))
               if (Graph->hasNodeForValue(CI->getArgOperand(y)))
                 toMerge.push_back(Graph->getNodeForValue(CI->getArgOperand(y)));
@@ -775,11 +777,11 @@
         for (unsigned y = 0; y < CI->getNumArgOperands(); ++y)
           if (isa<PointerType>(CI->getArgOperand(y)->getType())){
             if (Graph->hasNodeForValue(CI->getArgOperand(y))){
-              if (recFuncs[x].action.read[y])
+              if (recFuncs[x].action.read[y + 1])
                 Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setReadMarker();
-              if (recFuncs[x].action.write[y])
+              if (recFuncs[x].action.write[y + 1])
                 Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setModifiedMarker();
-              if (recFuncs[x].action.heap[y])
+              if (recFuncs[x].action.heap[y + 1])
                 Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setHeapMarker();
             }
           }
@@ -794,7 +796,7 @@
             if (Graph->hasNodeForValue(CI))
               toMerge.push_back(Graph->getNodeForValue(CI));
         for (unsigned y = 0; y < CI->getNumArgOperands(); ++y)
-          if (recFuncs[x].action.mergeNodes[y])
+          if (recFuncs[x].action.mergeNodes[y + 1])
             if (isa<PointerType>(CI->getArgOperand(y)->getType()))
               if (Graph->hasNodeForValue(CI->getArgOperand(y)))
                 toMerge.push_back(Graph->getNodeForValue(CI->getArgOperand(y)));
@@ -850,7 +852,7 @@
               // as appropriate.
               //
               for (unsigned y = 0; y < CI->getNumArgOperands(); ++y)
-                if (recFuncs[x].action.read[y]){
+                if (recFuncs[x].action.read[y + 1]){
                   if (isa<PointerType>(CI->getArgOperand(y)->getType())){
                     if (Graph->hasNodeForValue(CI->getArgOperand(y)))
                       Graph->getNodeForValue(CI->getArgOperand(y)).getNode()->setReadMarker();
@@ -871,7 +873,7 @@
                   if (Graph->hasNodeForValue(CI))
                     toMerge.push_back(Graph->getNodeForValue(CI));
               for (unsigned y = 0; y < CI->getNumArgOperands(); ++y)
-                if (recFuncs[x].action.mergeNodes[y])
+                if (recFuncs[x].action.mergeNodes[y + 1])
                   if (isa<PointerType>(CI->getArgOperand(y)->getType()))
                     if (Graph->hasNodeForValue(CI->getArgOperand(y)))
                       toMerge.push_back(Graph->getNodeForValue(CI->getArgOperand(y)));

Modified: poolalloc/branches/release_32/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/release_32/lib/DSA/TopDownClosure.cpp?rev=168890&r1=168889&r2=168890&view=diff
==============================================================================
--- poolalloc/branches/release_32/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/branches/release_32/lib/DSA/TopDownClosure.cpp Thu Nov 29 09:37:35 2012
@@ -77,13 +77,6 @@
   init(useEQBU ? &getAnalysis<EquivBUDataStructures>()
        : &getAnalysis<BUDataStructures>(),
        true, true, true, false);
-
-  for (Module::iterator F = M.begin(); F != M.end(); ++F) {
-    if (!(F->isDeclaration())){
-      DSGraph *G = getOrCreateGraph(F);
-      G->getAuxFunctionCalls().clear();
-    }
-  }
   // Figure out which functions must not mark their arguments complete because
   // they are accessible outside this compilation unit.  Currently, these
   // arguments are functions which are reachable by incomplete or external





More information about the llvm-commits mailing list