[llvm-commits] CVS: llvm-poolalloc/lib/DSA/CallTargets.cpp DataStructureOpt.cpp DataStructureStats.cpp Local.cpp Makefile

John Criswell criswell at cs.uiuc.edu
Wed Jan 10 12:00:22 PST 2007



Changes in directory llvm-poolalloc/lib/DSA:

CallTargets.cpp updated: 1.9 -> 1.10
DataStructureOpt.cpp updated: 1.16 -> 1.17
DataStructureStats.cpp updated: 1.26 -> 1.27
Local.cpp updated: 1.165 -> 1.166
Makefile updated: 1.6 -> 1.7
---
Log message:

Build a dynamically loadable library file.
Update to latest and greatest LLVM API.


---
Diffs of the changes:  (+34 -16)

 CallTargets.cpp        |    1 +
 DataStructureOpt.cpp   |    1 +
 DataStructureStats.cpp |    1 +
 Local.cpp              |   44 ++++++++++++++++++++++++++++----------------
 Makefile               |    3 +++
 5 files changed, 34 insertions(+), 16 deletions(-)


Index: llvm-poolalloc/lib/DSA/CallTargets.cpp
diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.9 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.10
--- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.9	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/CallTargets.cpp	Wed Jan 10 13:59:52 2007
@@ -23,6 +23,7 @@
 #include "dsa/DSGraph.h"
 #include "dsa/CallTargets.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/Support/Debug.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/Constants.h"
 #include <ostream>


Index: llvm-poolalloc/lib/DSA/DataStructureOpt.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.16 llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.17
--- llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.16	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/DataStructureOpt.cpp	Wed Jan 10 13:59:52 2007
@@ -19,6 +19,7 @@
 #include "llvm/Constant.h"
 #include "llvm/Type.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/Support/Debug.h"
 using namespace llvm;
 
 namespace {


Index: llvm-poolalloc/lib/DSA/DataStructureStats.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.26 llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.27
--- llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.26	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/DataStructureStats.cpp	Wed Jan 10 13:59:52 2007
@@ -19,6 +19,7 @@
 #include "llvm/Support/InstVisitor.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/Support/Debug.h"
 #include <ostream>
 using namespace llvm;
 


Index: llvm-poolalloc/lib/DSA/Local.cpp
diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.165 llvm-poolalloc/lib/DSA/Local.cpp:1.166
--- llvm-poolalloc/lib/DSA/Local.cpp:1.165	Wed Jan 10 12:10:32 2007
+++ llvm-poolalloc/lib/DSA/Local.cpp	Wed Jan 10 13:59:52 2007
@@ -171,7 +171,8 @@
     void visitStoreInst(StoreInst &SI);
     void visitCallInst(CallInst &CI);
     void visitInvokeInst(InvokeInst &II);
-    void visitSetCondInst(SetCondInst &SCI);
+    void visitICmpInst(ICmpInst &I);
+    void visitFCmpInst(FCmpInst &I);
     void visitFreeInst(FreeInst &FI);
     void visitCastInst(CastInst &CI);
     void visitInstruction(Instruction &I);
@@ -378,7 +379,14 @@
   Dest.mergeWith(getValueDest(*SI.getOperand(2)));
 }
 
-void GraphBuilder::visitSetCondInst(SetCondInst &SCI) {
+void GraphBuilder::visitICmpInst(ICmpInst &SCI) {
+  if (!isPointerType(SCI.getOperand(0)->getType()) ||
+      isa<ConstantPointerNull>(SCI.getOperand(1))) return; // Only pointers
+  if(!IgnoreSetCC)
+    ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1)));
+}
+
+void GraphBuilder::visitFCmpInst(FCmpInst &SCI) {
   if (!isPointerType(SCI.getOperand(0)->getType()) ||
       isa<ConstantPointerNull>(SCI.getOperand(1))) return; // Only pointers
   if(!IgnoreSetCC)
@@ -481,8 +489,12 @@
        I != E; ++I)
     if (const StructType *STy = dyn_cast<StructType>(*I)) {
       const ConstantInt* CUI = cast<ConstantInt>(I.getOperand());
+#if 0
       unsigned FieldNo = 
         CUI->getType()->isSigned() ? CUI->getSExtValue() : CUI->getZExtValue();
+#else
+      int FieldNo = CUI->getSExtValue();
+#endif
       Offset += (unsigned)TD.getStructLayout(STy)->MemberOffsets[FieldNo];
     } else if (isa<PointerType>(*I)) {
       if (!isa<Constant>(I.getOperand()) ||
@@ -768,7 +780,7 @@
       // argument node.
       const DSNodeHandle &EndPtrNH = getValueDest(**(CS.arg_begin()+1));
       if (DSNode *End = EndPtrNH.getNode()) {
-        End->mergeTypeInfo(PointerType::get(Type::SByteTy),
+        End->mergeTypeInfo(PointerType::get(Type::Int8Ty),
                            EndPtrNH.getOffset(), false);
         End->setModifiedMarker();
         DSNodeHandle &Link = getLink(EndPtrNH);
@@ -985,7 +997,7 @@
       const DSNodeHandle &VAList = getValueDest(**AI);
       if (DSNode *N = VAList.getNode()) {
         N->setReadMarker();
-        N->mergeTypeInfo(PointerType::get(Type::SByteTy),
+        N->mergeTypeInfo(PointerType::get(Type::Int8Ty),
         		 VAList.getOffset(), false);
 	
         DSNodeHandle &VAListObjs = getLink(VAList);
@@ -1133,7 +1145,7 @@
         //Get the Module first
         Module * M = F->getParent();
         //Now create a meta pool for this value, DSN Node
-        const Type * VoidPtrType = PointerType::get(Type::SByteTy);              
+        const Type * VoidPtrType = PointerType::get(Type::Int8Ty);              
         TheMetaPool = new GlobalVariable(
                                  /*type=*/ VoidPtrType,
                                  /*isConstant=*/ false,
@@ -1151,10 +1163,10 @@
       //Assumes AddPoolDescToMetaPool is in the module
       CastInst *CastMetaPool = 
         CastInst::createPointerCast (TheMetaPool, 
-                     PointerType::get(Type::SByteTy), "metapool.casted", InsertPoint);
+                     PointerType::get(Type::Int8Ty), "metapool.casted", InsertPoint);
       CastInst *CastActualPD = 
         CastInst::createPointerCast (actualPD, 
-                     PointerType::get(Type::SByteTy), "poolhandle.lscasted", InsertPoint);
+                     PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint);
       
       // Create the call to AddPoolDescToMetaPool 
       std::vector<Value *> args(1,CastMetaPool);
@@ -1196,7 +1208,7 @@
         //Get the Module first
         Module * M = F->getParent();
         //Now create a meta pool for this value, DSN Node
-        const Type * VoidPtrType = PointerType::get(Type::SByteTy);              
+        const Type * VoidPtrType = PointerType::get(Type::Int8Ty);              
         TheMetaPool = new GlobalVariable(
                                  /*type=*/ VoidPtrType,
                                  /*isConstant=*/ false,
@@ -1213,10 +1225,10 @@
       //Assumes AddPoolDescToMetaPool is in the module
       CastInst *CastMetaPool = 
         CastInst::createPointerCast (TheMetaPool, 
-                     PointerType::get(Type::SByteTy), "metapool.casted", InsertPoint);
+                     PointerType::get(Type::Int8Ty), "metapool.casted", InsertPoint);
       CastInst *CastActualPD = 
         CastInst::createPointerCast (actualPD, 
-                     PointerType::get(Type::SByteTy), "poolhandle.lscasted", InsertPoint);
+                     PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint);
       
       // Create the call to AddPoolDescToMetaPool 
       std::vector<Value *> args(1,CastMetaPool);
@@ -1290,7 +1302,7 @@
         if (G.getPoolDescriptorsMap().count(N)== 0) {
           //Here we insert a global meta pool
           //Now create a meta pool for this value, DSN Node
-          const Type * VoidPtrType = PointerType::get(Type::SByteTy);              
+          const Type * VoidPtrType = PointerType::get(Type::Int8Ty);              
           TheMetaPool = new GlobalVariable(
                                            /*type=*/ VoidPtrType,
                                            /*isConstant=*/ false,
@@ -1312,14 +1324,14 @@
         Instruction *InsertPoint = CS.getInstruction();
         
         //Assumes AddPoolDescToMetaPool is in the module
-        const Type * VoidPtrType = PointerType::get(Type::SByteTy);
+        const Type * VoidPtrType = PointerType::get(Type::Int8Ty);
         const Type * VoidPtrPtrType = PointerType::get(VoidPtrType);
         CastInst *CastMetaPool = 
           CastInst::createPointerCast (TheMetaPool, 
                        VoidPtrPtrType, "metapool.casted", InsertPoint);
         CastInst *CastActualPD = 
           CastInst::createPointerCast (actualPD, 
-                       PointerType::get(Type::SByteTy), "poolhandle.lscasted", InsertPoint);
+                       PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint);
         
         // Create the call to AddPoolDescToMetaPool 
         std::vector<Value *> args(1,CastMetaPool);
@@ -1376,7 +1388,7 @@
           //Here we insert a global meta pool
           //Get the Module first
           //Now create a meta pool for this value, DSN Node
-          const Type * VoidPtrType = PointerType::get(Type::SByteTy);              
+          const Type * VoidPtrType = PointerType::get(Type::Int8Ty);              
           TheMetaPool = new GlobalVariable(
                                            /*type=*/ VoidPtrType,
                                            /*isConstant=*/ false,
@@ -1391,14 +1403,14 @@
         Instruction *InsertPoint = CS.getInstruction();
         
         //Assumes AddPoolDescToMetaPool is in the module
-        const Type * VoidPtrType = PointerType::get(Type::SByteTy);
+        const Type * VoidPtrType = PointerType::get(Type::Int8Ty);
         const Type * VoidPtrPtrType = PointerType::get(VoidPtrType);
         CastInst *CastMetaPool = 
           CastInst::createPointerCast (TheMetaPool, 
                        VoidPtrPtrType, "metapool.casted", InsertPoint);
         CastInst *CastActualPD = 
           CastInst::createPointerCast (actualPD, 
-                       PointerType::get(Type::SByteTy), "poolhandle.lscasted", InsertPoint);
+                       PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint);
         
         // Create the call to AddPoolDescToMetaPool 
         std::vector<Value *> args(1,CastMetaPool);


Index: llvm-poolalloc/lib/DSA/Makefile
diff -u llvm-poolalloc/lib/DSA/Makefile:1.6 llvm-poolalloc/lib/DSA/Makefile:1.7
--- llvm-poolalloc/lib/DSA/Makefile:1.6	Wed Dec 13 23:51:06 2006
+++ llvm-poolalloc/lib/DSA/Makefile	Wed Jan 10 13:59:52 2007
@@ -8,6 +8,9 @@
 ##===----------------------------------------------------------------------===##
 
 LEVEL = ../..
+SHARED_LIBRARY=1
+LOADABLE_MODULE = 1
+DONT_BUILD_RELINKED=1
 LIBRARYNAME = LLVMDataStructure
 
 include $(LEVEL)/Makefile.common






More information about the llvm-commits mailing list