[llvm-commits] [poolalloc] r63547 - /poolalloc/branches/SVA/lib/DSA/Local.cpp

John Criswell criswell at uiuc.edu
Mon Feb 2 13:02:07 PST 2009


Author: criswell
Date: Mon Feb  2 15:02:07 2009
New Revision: 63547

URL: http://llvm.org/viewvc/llvm-project?rev=63547&view=rev
Log:
Fix recognition of allocators.
Make all kernel allocators and I/O allocators except kmem_cache_alloc()
allocate type-unknown memory objects.

Modified:
    poolalloc/branches/SVA/lib/DSA/Local.cpp

Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Local.cpp?rev=63547&r1=63546&r2=63547&view=diff

==============================================================================
--- poolalloc/branches/SVA/lib/DSA/Local.cpp (original)
+++ poolalloc/branches/SVA/lib/DSA/Local.cpp Mon Feb  2 15:02:07 2009
@@ -1513,10 +1513,23 @@
       RetNH = getValueDest(*CS.getInstruction());
       RetNH.getNode()->setHeapNodeMarker()->setModifiedMarker();
       RetNH.getNode()->getMP()->addCallSite(CS);
+
+      //
+      // Anything that is not a pool allocator must mark objects as
+      // type-unknown.
+      //
+      if (F->getName() != "kmem_cache_alloc")
+        RetNH.getNode()->foldNodeCompletely();
       return;
     }
 
 #ifdef SVA_IO
+    //
+    // Determine whether this is a call to a function that allocates an I/O
+    // object.  If so, then make it with the I/O flags and make it
+    // type-unknown (as the I/O device may treat the memory as a type different
+    // than what we infer).
+    //
     if (IOAllocList.end() != std::find(IOAllocList.begin(), IOAllocList.end(), F->getName())) {
       DSNodeHandle RetNH;
       if (F->getName() == "pseudo_alloc")
@@ -1525,6 +1538,7 @@
         RetNH = getValueDest(*CS.getInstruction());
       RetNH.getNode()->setIONodeMarker()->setModifiedMarker();
       RetNH.getNode()->getMP()->addCallSite(CS);
+      RetNH.getNode()->foldNodeCompletely();
       return;
     }
 #endif
@@ -1815,7 +1829,7 @@
   AllocList.push_back("__vmalloc");
   AllocList.push_back("kmem_cache_alloc");
   AllocList.push_back("__alloc_bootmem");
-  AllocList.push_back(" __get_free_pages");
+  AllocList.push_back("__get_free_pages");
   AllocList.push_back("pseudo_alloc");
   AllocList.push_back("malloc");
 





More information about the llvm-commits mailing list