[llvm-commits] [llvm] r101232 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
Nick Lewycky
nicholas at mxc.ca
Tue Apr 13 22:03:50 PDT 2010
Author: nicholas
Date: Wed Apr 14 00:03:50 2010
New Revision: 101232
URL: http://llvm.org/viewvc/llvm-project?rev=101232&view=rev
Log:
I don't know how, but I managed to goof the revert. Remove function that should
have been removed in r101231.
Modified:
llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=101232&r1=101231&r2=101232&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed Apr 14 00:03:50 2010
@@ -894,43 +894,6 @@
return true;
}
-bool DAE::RemoveDeadParamsFromCallersOf(Function *F) {
- // Don't modify fully live functions
- if (LiveFunctions.count(F))
- return false;
-
- // Make a list of the dead arguments.
- SmallVector<int, 10> ArgDead;
- unsigned i = 0;
- for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
- I != E; ++I, ++i) {
- RetOrArg Arg = CreateArg(F, i);
- if (!LiveValues.count(Arg))
- ArgDead.push_back(i);
- }
- if (ArgDead.empty())
- return false;
-
- bool MadeChange = false;
- for (Function::use_iterator I = F->use_begin(), E = F->use_end();
- I != E; ++I) {
- CallSite CS = CallSite::get(*I);
- if (CS.getInstruction() && CS.isCallee(I)) {
- for (unsigned i = 0, e = ArgDead.size(); i != e; ++i) {
- Value *A = CS.getArgument(ArgDead[i]);
- if (!isa<UndefValue>(A)) {
- ++NumParametersEliminated;
- MadeChange = true;
- CS.setArgument(ArgDead[i], UndefValue::get(A->getType()));
- RecursivelyDeleteTriviallyDeadInstructions(A);
- }
- }
- }
- }
-
- return MadeChange;
-}
-
bool DAE::runOnModule(Module &M) {
bool Changed = false;
More information about the llvm-commits
mailing list