https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126132

            Bug ID: 126132
           Summary: autoprofiledbootstrap slows down the compiler
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org
  Target Milestone: ---

Running cc1plus -O2 -w tramp3d-v4.i I see on cfarm136:

        speedup for stage3 auto-profiled autofdo   SAV
15.3:   1.46 +- 0.15                               1M
16.1:   1.02 +- 0.15                               1M
trunk:  -1.17 +- 0.03                              100k

I tried trunk on some other machines and with one of the insn-recog files, but
I see similar losses.

The original autofdo bootstrap patches saw +7%, 46% for 15.3 seem a bit high.
The results seem a bit noisy (I think the machine wasn't fully idle, but
hyperfine ran it ~10 times each), but clearly there is some problem with trunk.

I tried reducing the sample after value to 100k and 1M to get more samples but
it didn't seem to make too much difference.

If we take the numbers at face value it seems there were multiple regressions

Looking at the binaries the optimized binary is smaller:

   text    data     bss     dec     hex filename
48660248          68128 2003032 50731408        3061990 cc1plus
44462335          68128 2003000 46533463        2c60b57 cc1plus.opt (stage3)

comparing the sizes of the .cold functions .opt has 1.78MB of cold functions,
while stage2 has only 0.34MB. One theory is that tramp3d just hit very
different code than the bootstrap, and some critical code ends up being cold,
but that doesn't explain why insn-recog shows similar slowdowns.

It would be good to find a non noisy machine to do some more testing over time.

Reply via email to