Add a statistic to PHIElimination tracking the number of critical edges split.
authorCameron Zwarich <zwarich@apple.com>
Mon, 14 Feb 2011 02:09:11 +0000 (02:09 +0000)
committerCameron Zwarich <zwarich@apple.com>
Mon, 14 Feb 2011 02:09:11 +0000 (02:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125476 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PHIElimination.cpp

index b940e26911289630a81ca8a13b0f1222e69a12b3..f59e4f1aa3b73b2d3747721810264708a058b08b 100644 (file)
@@ -83,6 +83,7 @@ namespace {
 }
 
 STATISTIC(NumAtomic, "Number of atomic phis lowered");
+STATISTIC(NumCriticalEdgesSplit, "Number of critical edges split");
 STATISTIC(NumReused, "Number of reused lowered phis");
 
 char PHIElimination::ID = 0;
@@ -413,8 +414,12 @@ bool PHIElimination::SplitPHIEdges(MachineFunction &MF,
           !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) {
         if (!MLI ||
             !(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) &&
-              MLI->isLoopHeader(&MBB)))
-          Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0;
+              MLI->isLoopHeader(&MBB))) {
+          if (PreMBB->SplitCriticalEdge(&MBB, this)) {
+            Changed = true;
+            ++NumCriticalEdgesSplit;
+          }
+        }
       }
     }
   }