summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 4762011d63d..af2504682aa 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -501,7 +501,6 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg,
if (GEP->use_empty()) {
// Dead GEP's cause trouble later. Just remove them if we run into
// them.
- getAnalysis<AliasAnalysis>().deleteValue(GEP);
GEP->eraseFromParent();
// TODO: This runs the above loop over and over again for dead GEPs
// Couldn't we just do increment the UI iterator earlier and erase the
@@ -743,10 +742,6 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
F->getParent()->getFunctionList().insert(F, NF);
NF->takeName(F);
- // Get the alias analysis information that we need to update to reflect our
- // changes.
- AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
-
// Get the callgraph information that we need to update to reflect our
// changes.
CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
@@ -873,10 +868,6 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
Args.clear();
AttributesVec.clear();
- // Update the alias analysis implementation to know that we are replacing
- // the old call with a new one.
- AA.replaceWithNewValue(Call, New);
-
// Update the callgraph to know that the callsite has been transformed.
CallGraphNode *CalleeNode = CG[Call->getParent()->getParent()];
CalleeNode->replaceCallEdge(CS, CallSite(New), NF_CGN);
@@ -906,7 +897,6 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// new version.
I->replaceAllUsesWith(I2);
I2->takeName(I);
- AA.replaceWithNewValue(I, I2);
++I2;
continue;
}
@@ -935,7 +925,6 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Anything that used the arg should now use the alloca.
I->replaceAllUsesWith(TheAlloca);
TheAlloca->takeName(I);
- AA.replaceWithNewValue(I, TheAlloca);
// If the alloca is used in a call, we must clear the tail flag since
// the callee now uses an alloca from the caller.
@@ -948,10 +937,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
continue;
}
- if (I->use_empty()) {
- AA.deleteValue(I);
+ if (I->use_empty())
continue;
- }
// Otherwise, if we promoted this argument, then all users are load
// instructions (or GEPs with only load users), and all loads should be
@@ -964,7 +951,6 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
"Load element should sort to front!");
I2->setName(I->getName()+".val");
LI->replaceAllUsesWith(I2);
- AA.replaceWithNewValue(LI, I2);
LI->eraseFromParent();
DEBUG(dbgs() << "*** Promoted load of argument '" << I->getName()
<< "' in function '" << F->getName() << "'\n");
@@ -1001,10 +987,8 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
while (!GEP->use_empty()) {
LoadInst *L = cast<LoadInst>(GEP->user_back());
L->replaceAllUsesWith(TheArg);
- AA.replaceWithNewValue(L, TheArg);
L->eraseFromParent();
}
- AA.deleteValue(GEP);
GEP->eraseFromParent();
}
}
@@ -1013,10 +997,6 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
std::advance(I2, ArgIndices.size());
}
- // Tell the alias analysis that the old function is about to disappear.
- AA.replaceWithNewValue(F, NF);
-
-
NF_CGN->stealCalledFunctionsFrom(CG[F]);
// Now that the old function is dead, delete it. If there is a dangling
OpenPOWER on IntegriCloud