[PATCH] D11915: Let edge weight be always greater than zero in both BPI and MBPI.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 12:28:58 PDT 2015


congh added inline comments.

================
Comment at: test/Analysis/BlockFrequencyInfo/bad_input.ll:12
@@ -11,3 +11,3 @@
 
-; Check that we get 1,4 instead of 0,3.
-; CHECK-NEXT: for.body: float = 4.0,
+; Check that we get 1, ~UINT32_MAX instead of 0, 3.
+; CHECK-NEXT: for.body: float = 4294967291.0,
----------------
davidxl wrote:
> congh wrote:
> > davidxl wrote:
> > > Do we know what the original intention of the test case is?
> > This is testing if we have MD with 0, 3 as branch weights, in BFI we will get 1, 4 instead of 0, 3 as branch weights. In this patch we have eliminated zero weights so we should get 1 and a very large integer (around UINT32_MAX) as edge weights.
> What existing code in BPI/BFI changes 0,3 into 1,4?
It is done in lib/Analysis/BlockFrequencyInfoImpl.cpp:265. Actually this turns the edge weights from 0,3 into 1, 3, and then the frequency ratio of the loop body over the exit now becomes 1:4.


http://reviews.llvm.org/D11915





More information about the llvm-commits mailing list