aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-15 07:02:42 +0000
committerChris Lattner <sabre@nondot.org>2004-11-15 07:02:42 +0000
commitb77d5d8d50b146cc93082dbc07d5928ae80a20ca (patch)
tree19f0e21b77166148407164bb60e6a4968f62d18e /lib/Transforms
parent766d6f3b596e46eec4f96b403200205f682c023a (diff)
Count more accurately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index f3025523bc..9b55201407 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -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;
}
}