Set `BBF_RUN_RARELY` for a scratch first BB if called count is 0.
authorPat Gavlin <pagavlin@microsoft.com>
Wed, 26 Jul 2017 00:39:21 +0000 (17:39 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Wed, 26 Jul 2017 00:39:21 +0000 (17:39 -0700)
Just what it says on the tin.

Fixes VSO 469624.

src/jit/flowgraph.cpp

index 5dab6bb..0c8a28e 100644 (file)
@@ -12836,6 +12836,10 @@ void Compiler::fgComputeEdgeWeights()
         if (fgFirstBBisScratch())
         {
             fgFirstBB->setBBProfileWeight(fgCalledCount);
+            if (fgFirstBB->bbWeight == 0)
+            {
+                fgFirstBB->bbFlags |= BBF_RUN_RARELY;
+            }
         }
 
 #if DEBUG