[llvm-branch-commits] [llvm-branch] r99574 - in /llvm/branches/ggreif/const-CallSite: ./ include/llvm/ include/llvm/Support/ lib/Analysis/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/Transforms/Utils/ lib/VMCore/

Gabor Greif ggreif at gmail.com
Thu Mar 25 17:06:43 PDT 2010


Author: ggreif
Date: Thu Mar 25 19:06:43 2010
New Revision: 99574

URL: http://llvm.org/viewvc/llvm-project?rev=99574&view=rev
Log:
pull in r99564 from trunk and adapt to branch

Modified:
    llvm/branches/ggreif/const-CallSite/   (props changed)
    llvm/branches/ggreif/const-CallSite/include/llvm/Support/CFG.h
    llvm/branches/ggreif/const-CallSite/include/llvm/Value.h
    llvm/branches/ggreif/const-CallSite/lib/Analysis/CaptureTracking.cpp
    llvm/branches/ggreif/const-CallSite/lib/Analysis/LiveValues.cpp
    llvm/branches/ggreif/const-CallSite/lib/Analysis/MemoryBuiltins.cpp
    llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp
    llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/CodeGenPrepare.cpp
    llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/Reg2Mem.cpp
    llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp
    llvm/branches/ggreif/const-CallSite/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
    llvm/branches/ggreif/const-CallSite/lib/VMCore/Constants.cpp
    llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp
    llvm/branches/ggreif/const-CallSite/lib/VMCore/Globals.cpp
    llvm/branches/ggreif/const-CallSite/lib/VMCore/Instruction.cpp
    llvm/branches/ggreif/const-CallSite/lib/VMCore/Value.cpp

Propchange: llvm/branches/ggreif/const-CallSite/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 25 19:06:43 2010
@@ -1 +1,2 @@
 /llvm/branches/ggreif/InvokeInst-operands:98645-99398
+/llvm/trunk:99564

Modified: llvm/branches/ggreif/const-CallSite/include/llvm/Support/CFG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/include/llvm/Support/CFG.h?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/include/llvm/Support/CFG.h (original)
+++ llvm/branches/ggreif/const-CallSite/include/llvm/Support/CFG.h Thu Mar 25 19:06:43 2010
@@ -67,7 +67,7 @@
 
 typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
 typedef PredIterator<const BasicBlock,
-                     Value::use_const_iterator> pred_const_iterator;
+                     Value::const_use_iterator> pred_const_iterator;
 
 inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
 inline pred_const_iterator pred_begin(const BasicBlock *BB) {

Modified: llvm/branches/ggreif/const-CallSite/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/include/llvm/Value.h?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/include/llvm/Value.h (original)
+++ llvm/branches/ggreif/const-CallSite/include/llvm/Value.h Thu Mar 25 19:06:43 2010
@@ -157,13 +157,13 @@
   // Methods for handling the chain of uses of this Value.
   //
   typedef value_use_iterator<User>       use_iterator;
-  typedef value_use_iterator<const User> use_const_iterator;
+  typedef value_use_iterator<const User> const_use_iterator;
 
   bool               use_empty() const { return UseList == 0; }
   use_iterator       use_begin()       { return use_iterator(UseList); }
-  use_const_iterator use_begin() const { return use_const_iterator(UseList); }
+  const_use_iterator use_begin() const { return const_use_iterator(UseList); }
   use_iterator       use_end()         { return use_iterator(0);   }
-  use_const_iterator use_end()   const { return use_const_iterator(0);   }
+  const_use_iterator use_end()   const { return const_use_iterator(0);   }
   User              *use_back()        { return *use_begin(); }
   const User        *use_back()  const { return *use_begin(); }
 
@@ -172,7 +172,7 @@
   /// traversing the whole use list.
   ///
   bool hasOneUse() const {
-    use_const_iterator I = use_begin(), E = use_end();
+    const_use_iterator I = use_begin(), E = use_end();
     if (I == E) return false;
     return ++I == E;
   }

Modified: llvm/branches/ggreif/const-CallSite/lib/Analysis/CaptureTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Analysis/CaptureTracking.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Analysis/CaptureTracking.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Analysis/CaptureTracking.cpp Thu Mar 25 19:06:43 2010
@@ -49,7 +49,7 @@
   SmallSet<Use*, Threshold> Visited;
   int Count = 0;
 
-  for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();
+  for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
        UI != UE; ++UI) {
     // If there are lots of uses, conservatively say that the value
     // is captured to avoid taking too much compile time.

Modified: llvm/branches/ggreif/const-CallSite/lib/Analysis/LiveValues.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Analysis/LiveValues.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Analysis/LiveValues.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Analysis/LiveValues.cpp Thu Mar 25 19:06:43 2010
@@ -125,7 +125,7 @@
   bool LiveOutOfDefBB = false;
 
   // Examine each use of the value.
-  for (Value::use_const_iterator I = V->use_begin(), E = V->use_end();
+  for (Value::const_use_iterator I = V->use_begin(), E = V->use_end();
        I != E; ++I) {
     const User *U = *I;
     const BasicBlock *UseBB = cast<Instruction>(U)->getParent();

Modified: llvm/branches/ggreif/const-CallSite/lib/Analysis/MemoryBuiltins.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Analysis/MemoryBuiltins.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Analysis/MemoryBuiltins.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Analysis/MemoryBuiltins.cpp Thu Mar 25 19:06:43 2010
@@ -139,7 +139,7 @@
   unsigned NumOfBitCastUses = 0;
 
   // Determine if CallInst has a bitcast use.
-  for (Value::use_const_iterator UI = CI->use_begin(), E = CI->use_end();
+  for (Value::const_use_iterator UI = CI->use_begin(), E = CI->use_end();
        UI != E; )
     if (const BitCastInst *BCI = dyn_cast<BitCastInst>(*UI++)) {
       MallocType = cast<PointerType>(BCI->getDestTy());

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp Thu Mar 25 19:06:43 2010
@@ -129,7 +129,7 @@
 
   private:
     Liveness MarkIfNotLive(RetOrArg Use, UseVector &MaybeLiveUses);
-    Liveness SurveyUse(Value::use_const_iterator U, UseVector &MaybeLiveUses,
+    Liveness SurveyUse(Value::const_use_iterator U, UseVector &MaybeLiveUses,
                        unsigned RetValNum = 0);
     Liveness SurveyUses(const Value *V, UseVector &MaybeLiveUses);
 
@@ -310,7 +310,7 @@
 /// RetValNum is the return value number to use when this use is used in a
 /// return instruction. This is used in the recursion, you should always leave
 /// it at 0.
-DAE::Liveness DAE::SurveyUse(Value::use_const_iterator U, UseVector &MaybeLiveUses,
+DAE::Liveness DAE::SurveyUse(Value::const_use_iterator U, UseVector &MaybeLiveUses,
                              unsigned RetValNum) {
     const User *V = *U;
     if (const ReturnInst *RI = dyn_cast<ReturnInst>(V)) {
@@ -334,7 +334,7 @@
       // we don't change RetValNum, but do survey all our uses.
 
       Liveness Result = MaybeLive;
-      for (Value::use_const_iterator I = IV->use_begin(),
+      for (Value::const_use_iterator I = IV->use_begin(),
            E = V->use_end(); I != E; ++I) {
         Result = SurveyUse(I, MaybeLiveUses, RetValNum);
         if (Result == Live)
@@ -382,7 +382,7 @@
   // Assume it's dead (which will only hold if there are no uses at all..).
   Liveness Result = MaybeLive;
   // Check each use.
-  for (Value::use_const_iterator I = V->use_begin(),
+  for (Value::const_use_iterator I = V->use_begin(),
        E = V->use_end(); I != E; ++I) {
     Result = SurveyUse(I, MaybeLiveUses);
     if (Result == Live)
@@ -431,7 +431,7 @@
   unsigned NumLiveRetVals = 0;
   const Type *STy = dyn_cast<StructType>(F.getReturnType());
   // Loop all uses of the function.
-  for (Value::use_const_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
+  for (Value::const_use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
     // If the function is PASSED IN as an argument, its address has been
     // taken.
     CallSiteBase<> CS(*I);
@@ -454,7 +454,7 @@
     if (NumLiveRetVals != RetCount) {
       if (STy) {
         // Check all uses of the return value.
-        for (Value::use_const_iterator I = TheCall->use_begin(),
+        for (Value::const_use_iterator I = TheCall->use_begin(),
              E = TheCall->use_end(); I != E; ++I) {
           const ExtractValueInst *Ext = dyn_cast<ExtractValueInst>(*I);
           if (Ext && Ext->hasIndices()) {

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Mar 25 19:06:43 2010
@@ -174,7 +174,7 @@
   // don't mess around with them.
   BasicBlock::const_iterator BBI = BB->begin();
   while (const PHINode *PN = dyn_cast<PHINode>(BBI++)) {
-    for (Value::use_const_iterator UI = PN->use_begin(), E = PN->use_end();
+    for (Value::const_use_iterator UI = PN->use_begin(), E = PN->use_end();
          UI != E; ++UI) {
       const Instruction *User = cast<Instruction>(*UI);
       if (User->getParent() != DestBB || !isa<PHINode>(User))

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Mar 25 19:06:43 2010
@@ -1899,7 +1899,7 @@
       const Value *V = U->getValue();
       if (const Instruction *Inst = dyn_cast<Instruction>(V))
         if (L->contains(Inst)) continue;
-      for (Value::use_const_iterator UI = V->use_begin(), UE = V->use_end();
+      for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
            UI != UE; ++UI) {
         const Instruction *UserInst = dyn_cast<Instruction>(*UI);
         // Ignore non-instructions.

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/Reg2Mem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/Reg2Mem.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/Reg2Mem.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/Reg2Mem.cpp Thu Mar 25 19:06:43 2010
@@ -45,7 +45,7 @@
 
    bool valueEscapes(const Instruction *Inst) const {
      const BasicBlock *BB = Inst->getParent();
-      for (Value::use_const_iterator UI = Inst->use_begin(),E = Inst->use_end();
+      for (Value::const_use_iterator UI = Inst->use_begin(),E = Inst->use_end();
            UI != E; ++UI)
         if (cast<Instruction>(*UI)->getParent() != BB ||
             isa<PHINode>(*UI))

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp Thu Mar 25 19:06:43 2010
@@ -1709,7 +1709,7 @@
   // Delete any dead constantexpr klingons.
   GV->removeDeadConstantUsers();
 
-  for (Value::use_const_iterator UI = GV->use_begin(), E = GV->use_end();
+  for (Value::const_use_iterator UI = GV->use_begin(), E = GV->use_end();
        UI != E; ++UI) {
     const User *U = *UI;
     if (const StoreInst *SI = dyn_cast<StoreInst>(U)) {

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Thu Mar 25 19:06:43 2010
@@ -68,7 +68,7 @@
   // assignments to subsections of the memory unit.
 
   // Only allow direct and non-volatile loads and stores...
-  for (Value::use_const_iterator UI = AI->use_begin(), UE = AI->use_end();
+  for (Value::const_use_iterator UI = AI->use_begin(), UE = AI->use_end();
        UI != UE; ++UI)     // Loop over all of the uses of the alloca
     if (const LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
       if (LI->isVolatile())

Modified: llvm/branches/ggreif/const-CallSite/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/VMCore/Constants.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/VMCore/Constants.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/VMCore/Constants.cpp Thu Mar 25 19:06:43 2010
@@ -160,7 +160,7 @@
 /// isConstantUsed - Return true if the constant has users other than constant
 /// exprs and other dangling things.
 bool Constant::isConstantUsed() const {
-  for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
+  for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
     const Constant *UC = dyn_cast<Constant>(*UI);
     if (UC == 0 || isa<GlobalValue>(UC))
       return true;

Modified: llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp Thu Mar 25 19:06:43 2010
@@ -404,7 +404,7 @@
 /// hasAddressTaken - returns true if there are any uses of this function
 /// other than direct calls or invokes to it.
 bool Function::hasAddressTaken(const User* *PutOffender) const {
-  for (Value::use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
+  for (Value::const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
     const User *U = *I;
     if (!isa<CallInst>(U) && !isa<InvokeInst>(U))
       return PutOffender ? (*PutOffender = U, true) : true;

Modified: llvm/branches/ggreif/const-CallSite/lib/VMCore/Globals.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/VMCore/Globals.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/VMCore/Globals.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/VMCore/Globals.cpp Thu Mar 25 19:06:43 2010
@@ -61,8 +61,8 @@
 /// that want to check to see if a global is unused, but don't want to deal
 /// with potentially dead constants hanging off of the globals.
 void GlobalValue::removeDeadConstantUsers() const {
-  Value::use_const_iterator I = use_begin(), E = use_end();
-  Value::use_const_iterator LastNonDeadUser = E;
+  Value::const_use_iterator I = use_begin(), E = use_end();
+  Value::const_use_iterator LastNonDeadUser = E;
   while (I != E) {
     if (const Constant *User = dyn_cast<Constant>(*I)) {
       if (!removeDeadUsersOfConstant(User)) {

Modified: llvm/branches/ggreif/const-CallSite/lib/VMCore/Instruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/VMCore/Instruction.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/VMCore/Instruction.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/VMCore/Instruction.cpp Thu Mar 25 19:06:43 2010
@@ -283,7 +283,7 @@
 /// specified block.  Note that PHI nodes are considered to evaluate their
 /// operands in the corresponding predecessor block.
 bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {
-  for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
+  for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
     // PHI nodes uses values in the corresponding predecessor block.  For other
     // instructions, just check to see whether the parent of the use matches up.
     const PHINode *PN = dyn_cast<PHINode>(*UI);

Modified: llvm/branches/ggreif/const-CallSite/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/VMCore/Value.cpp?rev=99574&r1=99573&r2=99574&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/VMCore/Value.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/VMCore/Value.cpp Thu Mar 25 19:06:43 2010
@@ -86,7 +86,7 @@
 /// hasNUses - Return true if this Value has exactly N users.
 ///
 bool Value::hasNUses(unsigned N) const {
-  use_const_iterator UI = use_begin(), E = use_end();
+  const_use_iterator UI = use_begin(), E = use_end();
 
   for (; N; --N, ++UI)
     if (UI == E) return false;  // Too few.
@@ -97,7 +97,7 @@
 /// logically equivalent to getNumUses() >= N.
 ///
 bool Value::hasNUsesOrMore(unsigned N) const {
-  use_const_iterator UI = use_begin(), E = use_end();
+  const_use_iterator UI = use_begin(), E = use_end();
 
   for (; N; --N, ++UI)
     if (UI == E) return false;  // Too few.
@@ -108,7 +108,7 @@
 /// isUsedInBasicBlock - Return true if this value is used in the specified
 /// basic block.
 bool Value::isUsedInBasicBlock(const BasicBlock *BB) const {
-  for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
+  for (const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
     const Instruction *User = dyn_cast<Instruction>(*I);
     if (User && User->getParent() == BB)
       return true;





More information about the llvm-branch-commits mailing list