Fix for edge profiling, patch by 'Marc' for PR1857
authorChris Lattner <sabre@nondot.org>
Thu, 13 Dec 2007 00:04:46 +0000 (00:04 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 13 Dec 2007 00:04:46 +0000 (00:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44965 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/EdgeProfiling.cpp

index 360d2b7db715adca4524cef147ef7eb5b66fc30c..ca81176d329cf1d3545ebeeed22fced84e9939ab 100644 (file)
@@ -84,7 +84,7 @@ bool EdgeProfiler::runOnModule(Module &M) {
           // Okay, we are guaranteed that the edge is no longer critical.  If we
           // only have a single successor, insert the counter in this block,
           // otherwise insert it in the successor block.
-          if (TI->getNumSuccessors() == 0) {
+          if (TI->getNumSuccessors() == 1) {
             // Insert counter at the start of the block
             IncrementCounterInBlock(BB, i++, Counters);
           } else {