mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Count more accurately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
766d6f3b59
commit
b77d5d8d50
@ -44,6 +44,7 @@ using namespace llvm;
|
||||
//
|
||||
namespace {
|
||||
Statistic<> NumInstRemoved("sccp", "Number of instructions removed");
|
||||
Statistic<> NumDeadBlocks ("sccp", "Number of basic blocks unreachable");
|
||||
|
||||
class LatticeVal {
|
||||
enum {
|
||||
@ -853,6 +854,8 @@ bool SCCP::runOnFunction(Function &F) {
|
||||
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
|
||||
if (!ExecutableBBs.count(BB)) {
|
||||
DEBUG(std::cerr << " BasicBlock Dead:" << *BB);
|
||||
++NumDeadBlocks;
|
||||
|
||||
// Delete the instructions backwards, as it has a reduced likelihood of
|
||||
// having to update as many def-use and use-def chains.
|
||||
std::vector<Instruction*> Insts;
|
||||
@ -866,6 +869,7 @@ bool SCCP::runOnFunction(Function &F) {
|
||||
I->replaceAllUsesWith(UndefValue::get(I->getType()));
|
||||
BB->getInstList().erase(I);
|
||||
MadeChanges = true;
|
||||
++NumInstRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user