[PATCH] D13218: Mark BB as annotated if its weight is > 0

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 07:44:48 PDT 2015


danielcdh added inline comments.

================
Comment at: include/llvm/ProfileData/SampleProf.h:221
@@ -220,3 +216,1 @@
-    if (Num == 0)
-      Num = 1;
     BodySamples[LineLocation(LineOffset, Discriminator)].addSamples(Num);
----------------
dnovillo wrote:
> Sadly, I don't think there is a test case for this check I had added.  With your new changes, we can now distinguish 0 from missing sample all the time, right?
Yes, now GetBlockCount will return std::error_code if there is no profile.

================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:505
@@ -504,3 @@
-    PDT->getDescendants(BB1, DominatedBBs);
-    findEquivalencesFor(BB1, DominatedBBs, DT.get());
-
----------------
dnovillo wrote:
> Not sure why we don't process blocks post-dominated by BB1 anymore?
Processing dominators should be able to cover all ECs, this is because if BB1 dominates BB2, and BB1 and BB2 are in the same EC, then BB2 also post-dominates BB1.


http://reviews.llvm.org/D13218





More information about the llvm-commits mailing list