mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 08:24:12 +00:00
Remove useless statistic, fix some slightly broken logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14958 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5827aebe64
commit
25c6d68029
@ -26,7 +26,6 @@ using namespace llvm;
|
||||
namespace {
|
||||
Statistic<> NumFunctions("globaldce","Number of functions removed");
|
||||
Statistic<> NumVariables("globaldce","Number of global variables removed");
|
||||
Statistic<> NumGVs("globaldce", "Number of global values removed");
|
||||
|
||||
struct GlobalDCE : public Pass {
|
||||
// run - Do the GlobalDCE pass on the specified module, optionally updating
|
||||
@ -171,13 +170,10 @@ void GlobalDCE::MarkUsedGlobalsAsNeeded(Constant *C) {
|
||||
// might make it deader.
|
||||
//
|
||||
bool GlobalDCE::RemoveUnusedGlobalValue(GlobalValue &GV) {
|
||||
for (Value::use_iterator I = GV.use_begin(), E = GV.use_end(); I != E; ++I)
|
||||
if (GlobalValue* User = dyn_cast<GlobalValue>(*I))
|
||||
if (User->removeDeadConstantUsers()) { // Only if unreferenced...
|
||||
++NumGVs;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (GV.use_empty()) return false;
|
||||
GV.removeDeadConstantUsers();
|
||||
return GV.use_empty();
|
||||
}
|
||||
|
||||
// SafeToDestroyConstant - It is safe to destroy a constant iff it is only used
|
||||
// by constants itself. Note that constants cannot be cyclic, so this test is
|
||||
|
Loading…
x
Reference in New Issue
Block a user