[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 11:58:16 PDT 2015


congh added a comment.

In http://reviews.llvm.org/D11915#221943, @davidxl wrote:

> I thought we need to fix MBPI to handle bad interactions of  with weight normalization and zero weight. Why do we need to fix BPI?


Zero weights have two meanings in MBPI: 1. It is a real zero weight that is from BPI. 2. It is an unknown weight. If we require that all weights from BPI cannot be zero, then it now only has the second meaning. The test failures on the weight normalization patch can now be fixed (note that those tests contains prof_data with 0 edge weights, which are eliminated in BPI now).


================
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:
> 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.


http://reviews.llvm.org/D11915





More information about the llvm-commits mailing list