[llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp

LLVM llvm at cs.uiuc.edu
Sat Jul 17 17:24:01 PDT 2004



Changes in directory llvm/lib/Transforms/IPO:

ArgumentPromotion.cpp updated: 1.7 -> 1.8

---
Log message:

bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Excise dead CPR procesing.


---
Diffs of the changes:  (+1 -30)

Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.7 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.8
--- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.7	Sun Jun 20 19:07:58 2004
+++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp	Sat Jul 17 19:23:51 2004
@@ -86,37 +86,8 @@
 bool ArgPromotion::run(Module &M) {
   bool Changed = false;
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
-    if (I->hasInternalLinkage()) {
+    if (I->hasInternalLinkage())
       WorkList.insert(I);
-
-      // If there are any constant pointer refs pointing to this function,
-      // eliminate them now if possible.
-      ConstantPointerRef *CPR = 0;
-      for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
-           ++UI)
-        if ((CPR = dyn_cast<ConstantPointerRef>(*UI)))
-          break;  // Found one!
-      if (CPR) {
-        // See if we can transform all users to use the function directly.
-        while (!CPR->use_empty()) {
-          User *TheUser = CPR->use_back();
-          if (!isa<Constant>(TheUser) && !isa<GlobalVariable>(TheUser)) {
-            Changed = true;
-            TheUser->replaceUsesOfWith(CPR, I);
-          } else {
-            // We won't be able to eliminate all users.  :(
-            WorkList.erase(I);  // Minor efficiency win.
-            break;
-          }
-        }
-
-        // If we nuked all users of the CPR, kill the CPR now!
-        if (CPR->use_empty()) {
-          CPR->destroyConstant();
-          Changed = true;
-        }
-      }
-    }
   
   while (!WorkList.empty()) {
     Function *F = *WorkList.begin();





More information about the llvm-commits mailing list