[Bug ipa/92074] [10 regression] 26% performance regression on Spec2017 548.exchange2_r

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 14 20:07:00 GMT 2019


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

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The regression is because we now inline covered into digits2:

IPA function summary for digits_2/29 inlinable
  global time:     1553.078985
  self size:       1295
  global size:     1295
  min size:       0
  self stack:      261
  global stack:    261
    size:981.000000, time:1505.442572
    size:3.000000, time:1.999121,  executed if:(not inlined)
    size:0.500000, time:0.500000,  executed if:(not inlined),  nonconst
if:(op0[ref offset: 0] changed) && (not inlined)
    size:210.500000, time:27.456610,  nonconst if:(op0[ref offset: 0] changed)
    size:21.000000, time:3.795164,  executed if:(op0[ref offset: 0] == 5)
    size:6.000000, time:0.334389,  executed if:(op0[ref offset: 0] != 8)
    size:1.000000, time:0.033237,  executed if:(op0[ref offset: 0] != 8), 
nonconst if:(op0[ref offset: 0] changed) && (op0[ref offset: 0] != 8)
    size:66.000000, time:13.130882,  executed if:(op0[ref offset: 0] == 8)
  loop iterations:(op0[ref offset: 0] changed)
  calls:
    digits_2/29 function not considered for inlining
      loop depth: 9 freq:0.03 size: 2 time: 11callee size:647 stack:261
predicate: (op0[ref offset: 0] != 8)
       op0 is compile time invariant
    covered.constprop/93 function not considered for inlining
      loop depth: 9 freq:0.00 size: 4 time: 13callee size:214 stack:1472
predicate: (op0[ref offset: 0] == 8)
       op0 is compile time invariant
       op1 is compile time invariant

digits_2 is quite deeply recursive and inlining quite expensive function
"covered" does not help. 

This can be solved by --param inline-heuristics-hint-percent=600
the current default of 1600 is way too high and I scheduled some benchmarks to
tune it down but unfortunately our LNT benchmarking is down currently. (I would
like to see it reduced to even lower value if polyhedron and SPEC testing is
happy about that)

Generally it would be nice if inliner understood that inlining into self
recursive functions on the path that is not going to recursion may be harmful.
This we do not model and thus this works/does not work sort of randomly.


More information about the Gcc-bugs mailing list