mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
Remove some dead code. ctor evaluation subsumes empty ctor elim
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a22fdb0a37
commit
ff0c1ef9eb
@ -45,7 +45,6 @@ namespace {
|
||||
"Number of global vars shrunk to booleans");
|
||||
Statistic<> NumFastCallFns("globalopt",
|
||||
"Number of functions converted to fastcc");
|
||||
Statistic<> NumEmptyCtor ("globalopt", "Number of empty ctors removed");
|
||||
Statistic<> NumCtorsEvaluated("globalopt","Number of static ctors evaluated");
|
||||
|
||||
struct GlobalOpt : public ModulePass {
|
||||
@ -926,7 +925,6 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
|
||||
Module::global_iterator &GVI) {
|
||||
std::set<PHINode*> PHIUsers;
|
||||
GlobalStatus GS;
|
||||
PHIUsers.clear();
|
||||
GV->removeDeadConstantUsers();
|
||||
|
||||
if (GV->use_empty()) {
|
||||
@ -1552,16 +1550,6 @@ bool GlobalOpt::OptimizeGlobalCtorsList(GlobalVariable *&GCL) {
|
||||
++NumCtorsEvaluated;
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the function is empty, just remove it from the ctor list.
|
||||
if (isa<ReturnInst>(F->begin()->getTerminator()) &&
|
||||
&F->begin()->front() == F->begin()->getTerminator()) {
|
||||
Ctors.erase(Ctors.begin()+i);
|
||||
MadeChange = true;
|
||||
--i;
|
||||
++NumEmptyCtor;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!MadeChange) return false;
|
||||
|
Loading…
Reference in New Issue
Block a user