[llvm-bugs] [Bug 38492] New: Incorrect block frequencies for profile-optimized compilation after jump threading

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 8 15:28:29 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38492

            Bug ID: 38492
           Summary: Incorrect block frequencies for profile-optimized
                    compilation after jump threading
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: dcallahan at fb.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20660
  --> https://bugs.llvm.org/attachment.cgi?id=20660&action=edit
test case

This bug is reduced from the spec2017 602.gcc test which is compiled with a
sample-based profiling. 

After jump threading  the default compilation generates an wild execution
frequency for some blocks. If jump threading is disabled
(-jump-threading-threshold=0) then more reasonable frequencies are generated.
For example, diffing the output of -debug-only=block-freq illustrates

<  - while.body.i74: float = 1342177279.8, scaled = 28633115303.3, int =
28633115303
---
>  - while.body.i74: float = 60.15625113, scaled = 1283.333358, int = 1283

The relative frequency of 60 is plausible while the other is not.

Jump threading updates the branch weights in two places. Curiously one place is
explicitly disabled when the there are existing profile weights while the other
explicitly requires profiling to already be present. These choices interact
poorly when the first example finds on profile branch weights and so creates
them in a context the second seems it should not have them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180808/c0c4cc88/attachment.html>


More information about the llvm-bugs mailing list