aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 00:23:51 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 00:23:51 +0000
commit317815891826673a117554c7b5bf1431c253c4e7 (patch)
treeb72ae9cecac7847164c3c2ae033fe62ac0cc5d1a /lib
parentd02fccfdb878436215054f79a8dc8d81aad6b915 (diff)
downloadexternal_llvm-317815891826673a117554c7b5bf1431c253c4e7.zip
external_llvm-317815891826673a117554c7b5bf1431c253c4e7.tar.gz
external_llvm-317815891826673a117554c7b5bf1431c253c4e7.tar.bz2
bug 122:
- Excise dead CPR procesing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14944 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 1c76487..fe945c4 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -86,37 +86,8 @@ Pass *llvm::createArgumentPromotionPass() {
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();