[llvm-commits] [poolalloc] r137087 - in /poolalloc/trunk: include/assistDS/IndCloner.h include/assistDS/Int2PtrCmp.h include/assistDS/LoadArgs.h include/assistDS/MergeGEP.h lib/AssistDS/IndCloner.cpp lib/AssistDS/LoadArgs.cpp lib/AssistDS/MergeGEP.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Mon Aug 8 17:38:50 PDT 2011


Author: aggarwa4
Date: Mon Aug  8 19:38:50 2011
New Revision: 137087

URL: http://llvm.org/viewvc/llvm-project?rev=137087&view=rev
Log:
Changes to compile with mainline

Modified:
    poolalloc/trunk/include/assistDS/IndCloner.h
    poolalloc/trunk/include/assistDS/Int2PtrCmp.h
    poolalloc/trunk/include/assistDS/LoadArgs.h
    poolalloc/trunk/include/assistDS/MergeGEP.h
    poolalloc/trunk/lib/AssistDS/IndCloner.cpp
    poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
    poolalloc/trunk/lib/AssistDS/MergeGEP.cpp

Modified: poolalloc/trunk/include/assistDS/IndCloner.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/IndCloner.h?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/IndCloner.h (original)
+++ poolalloc/trunk/include/assistDS/IndCloner.h Mon Aug  8 19:38:50 2011
@@ -27,7 +27,7 @@
   class IndClone : public ModulePass {
   public:
     static char ID;
-    IndClone() : ModulePass(&ID) {}
+    IndClone() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
   };
 }

Modified: poolalloc/trunk/include/assistDS/Int2PtrCmp.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/Int2PtrCmp.h?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/Int2PtrCmp.h (original)
+++ poolalloc/trunk/include/assistDS/Int2PtrCmp.h Mon Aug  8 19:38:50 2011
@@ -29,7 +29,7 @@
     TargetData * TD;
   public:
     static char ID;
-    Int2PtrCmp() : ModulePass(&ID) {}
+    Int2PtrCmp() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<TargetData>();

Modified: poolalloc/trunk/include/assistDS/LoadArgs.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/LoadArgs.h?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/LoadArgs.h (original)
+++ poolalloc/trunk/include/assistDS/LoadArgs.h Mon Aug  8 19:38:50 2011
@@ -29,7 +29,7 @@
   class LoadArgs : public ModulePass {
   public:
     static char ID;
-    LoadArgs() : ModulePass(&ID) {}
+    LoadArgs() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
   };
 }

Modified: poolalloc/trunk/include/assistDS/MergeGEP.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/MergeGEP.h?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/MergeGEP.h (original)
+++ poolalloc/trunk/include/assistDS/MergeGEP.h Mon Aug  8 19:38:50 2011
@@ -23,7 +23,7 @@
   class MergeArrayGEP : public ModulePass {
   public:
     static char ID;
-    MergeArrayGEP() : ModulePass(&ID) {}
+    MergeArrayGEP() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
   };
 }

Modified: poolalloc/trunk/lib/AssistDS/IndCloner.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/IndCloner.cpp?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/IndCloner.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/IndCloner.cpp Mon Aug  8 19:38:50 2011
@@ -73,7 +73,7 @@
     if (!I->isDeclaration() && !I->mayBeOverridden()) {
       for (Value::use_iterator ui = I->use_begin(), ue = I->use_end();
           ui != ue; ++ui) {
-        if (!isa<CallInst>(ui) && !isa<InvokeInst>(ui)) {
+        if (!isa<CallInst>(*ui) && !isa<InvokeInst>(*ui)) {
           if(!ui->use_empty())
           //
           // If this function is used for anything other than a direct function
@@ -148,7 +148,7 @@
     for (Value::use_iterator ui = Original->use_begin(),
                              ue = Original->use_end();
         ui != ue; ) {
-      CallInst *CI = dyn_cast<CallInst>(ui);
+      CallInst *CI = dyn_cast<CallInst>(*ui);
       ui++;
       if (CI) {
         if (CI->getOperand(0) == Original) {

Modified: poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/LoadArgs.cpp?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/LoadArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/LoadArgs.cpp Mon Aug  8 19:38:50 2011
@@ -19,6 +19,7 @@
 #include "llvm/Support/GetElementPtrTypeIterator.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/ValueMap.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Use.h"
@@ -118,7 +119,7 @@
 
           // Construct the new Type
           // Appends the struct Type at the beginning
-          std::vector<const Type*>TP;
+          std::vector<Type*>TP;
           for(unsigned c = 1; c < CI->getNumOperands();c++) {
             if(c == argNum)
               TP.push_back(LI->getOperand(0)->getType());
@@ -126,7 +127,7 @@
           }
 
           //return type is same as that of original instruction
-          const FunctionType *NewFTy = FunctionType::get(CI->getType(), TP, false);
+          FunctionType *NewFTy = FunctionType::get(CI->getType(), TP, false);
           numSimplified++;
           //if(numSimplified > 1000)
           //return true;
@@ -145,7 +146,7 @@
             fnCache[std::make_pair(F, NewFTy)] = NewF;
             Function::arg_iterator NI = NewF->arg_begin();
 
-            DenseMap<const Value*, Value*> ValueMap;
+            ValueToValueMapTy ValueMap;
 
             unsigned count = 1;
             for (Function::arg_iterator II = F->arg_begin(); NI != NewF->arg_end(); ++count, ++NI) {
@@ -160,7 +161,7 @@
             }
             // Perform the cloning.
             SmallVector<ReturnInst*,100> Returns;
-            CloneFunctionInto(NewF, F, ValueMap, Returns);
+            CloneFunctionInto(NewF, F, ValueMap, false, Returns);
             std::vector<Value*> fargs;
             for(Function::arg_iterator ai = NewF->arg_begin(), 
                 ae= NewF->arg_end(); ai != ae; ++ai) {
@@ -202,7 +203,7 @@
 
           AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
                                                     AttributesVec.end());
-          CallInst *CallI = CallInst::Create(NewF,Args.begin(), Args.end(),"", CI);
+          CallInst *CallI = CallInst::Create(NewF,Args,"", CI);
           CallI->setCallingConv(CI->getCallingConv());
           CallI->setAttributes(NewCallPAL);
           CI->replaceAllUsesWith(CallI);

Modified: poolalloc/trunk/lib/AssistDS/MergeGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/MergeGEP.cpp?rev=137087&r1=137086&r2=137087&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/MergeGEP.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/MergeGEP.cpp Mon Aug  8 19:38:50 2011
@@ -14,6 +14,7 @@
 
 #include "assistDS/MergeGEP.h"
 #include "llvm/Instructions.h"
+#include "llvm/Operator.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Instructions.h"
@@ -140,10 +141,10 @@
 
     if (!Indices.empty()){
       GetElementPtrInst *GEPNew =  (GEP->isInBounds() && Src->isInBounds()) ?
-        GetElementPtrInst::CreateInBounds(Src->getOperand(0), Indices.begin(),
-                                          Indices.end(), GEP->getName(), GEP) :
-        GetElementPtrInst::Create(Src->getOperand(0), Indices.begin(),
-                                  Indices.end(), GEP->getName(), GEP);
+        GetElementPtrInst::CreateInBounds(Src->getOperand(0), Indices,
+                                          GEP->getName(), GEP) :
+        GetElementPtrInst::Create(Src->getOperand(0), Indices,
+                                  GEP->getName(), GEP);
       numMerged++;
       GEP->replaceAllUsesWith(GEPNew);
       GEP->eraseFromParent();





More information about the llvm-commits mailing list