[llvm-commits] [poolalloc] r98856 - in /poolalloc/trunk/lib/DSA: BottomUpClosure.cpp Local.cpp

Andrew Lenharth andrewl at lenharth.org
Thu Mar 18 13:05:15 PDT 2010


Author: alenhar2
Date: Thu Mar 18 15:05:15 2010
New Revision: 98856

URL: http://llvm.org/viewvc/llvm-project?rev=98856&view=rev
Log:
do something with inline asm

Modified:
    poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
    poolalloc/trunk/lib/DSA/Local.cpp

Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=98856&r1=98855&r2=98856&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Thu Mar 18 15:05:15 2010
@@ -73,7 +73,7 @@
     svset<const Function*> marked;
     for (DSCallGraph::root_iterator ii = callgraph.root_begin(),
          ee = callgraph.root_end(); ii != ee; ++ii) {
-      errs() << (*ii)->getName() << "\n";
+      //errs() << (*ii)->getName() << "\n";
       DSGraph* G = postOrder(*ii, marked);
       CloneAuxIntoGlobal(G);
     }
@@ -288,8 +288,8 @@
    // Note that this is *required* for correctness.  If a callee contains a use
    // of a global, we have to make sure to link up nodes due to global-argument
    // bindings.
-//   if (ContainsMain)
-//     cloneGlobalsInto(Graph);
+   if (ContainsMain)
+    cloneGlobalsInto(Graph);
 
   // Move our call site list into TempFCs so that inline call sites go into the
   // new call site list and doesn't invalidate our iterators!
@@ -356,7 +356,7 @@
   // reach live nodes as live.
   Graph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
 
-//  cloneIntoGlobals(Graph);
+  cloneIntoGlobals(Graph);
   //Graph.writeGraphToFile(cerr, "bu_" + F.getName());
 }
 

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=98856&r1=98855&r2=98856&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Thu Mar 18 15:05:15 2010
@@ -750,12 +750,25 @@
     return;
 
   //Can't do much about inline asm (yet!)
-  if (isa<InlineAsm>(CS.getCalledValue())) return;
+  if (isa<InlineAsm>(CS.getCalledValue())) {
+    DSNodeHandle RetVal;
+    Instruction *I = CS.getInstruction();
+    if (isa<PointerType > (I->getType()))
+      RetVal = getValueDest(I);
+
+    // Calculate the arguments vector...
+    for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I)
+      if (isa<PointerType > ((*I)->getType()))
+        RetVal.mergeWith(getValueDest(*I));
+    if (!RetVal.isNull())
+      RetVal.getNode()->foldNodeCompletely();
+    return;
+  }
 
   //uninteresting direct call
   if (CS.getCalledFunction() && !DSCallGraph::hasPointers(CS))
     return;
-  
+
 
 //  if (InlineAsm* IASM = dyn_cast<InlineAsm>(CS.getCalledValue())) {
 //    if (IASM->hasSideEffects())





More information about the llvm-commits mailing list