[llvm-bugs] [Bug 28991] New: Incorrect sample profiles at O3

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 15 16:40:57 PDT 2016


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

            Bug ID: 28991
           Summary: Incorrect sample profiles at O3
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dcallahan at fb.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16963
  --> https://llvm.org/bugs/attachment.cgi?id=16963&action=edit
Tar file of script and input files

bug2.sh generates the reproduction where we compile a training program either
-00 or -03. 

The -O0 training yield this sample

Function: _Z8clampSumPdidd: 105434939, 1, 14 sampled lines
Samples collected in the function's body {
  0: 1
  1: 1
  2.1: 949899
  2.2: 949797
  3: 949833
  4: 0
  5: 949926
  6: 949896
  7: 0
  8: 949929
  9: 949904
  11: 949889
  12: 949809
  14: 4
}

while the -O3 training yields this sample 

Function: _Z8clampSumPdidd: 76108151, 2, 9 sampled lines
Samples collected in the function's body {
  0: 2
  2.1: 1435907
  3: 1436091
  6: 1436048
  7: 1436032
  9: 2
  11: 1435984
  12: 1435974
  14: 2
}

Note the differences in values for relative statements 7 and 9.
The corresponding branch_weights are
   !74 = !{!"branch_weights", i32 1, i32 949905}
and 
   !74 = !{!"branch_weights", i32 1436033, i32 3}

The -O3 sample inverts the relative weights relative to the (correct) -O0
sample.

The attached tar file has bug2.sh, bug.cc and main.cc and a snapshot of bug2.sh
output.

-- 
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/20160815/e0eb0260/attachment-0001.html>


More information about the llvm-bugs mailing list