[GHC] #8901: (very) bad inline heuristics

GHC ghc-devs at haskell.org
Sat Mar 15 23:29:31 UTC 2014


#8901: (very) bad inline heuristics
------------------------------------+-------------------------------------
       Reporter:  heisenbug         |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.7
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 I observe a bad case for inlining blowup for the time library. Observed
 for 7.7, just checked in 7.9.

 The problem is so bad that the PowerPC32 assembler cannot resolve cross-
 routine references.
 (I have no error message at hand, but could try to get one.)

 Instead here are the stats for x86, with inlining and certain inlining
 suppressed. The architecture seems irrelevant.
 {{{
 $ file ./libraries/time/dist-install/build/Data/Time/Format.o
 ./libraries/time/dist-install/build/Data/Time/Format.o: Mach-O object i386

 $ ls -l ./libraries/time/dist-install/build/Data/Time/Format.*
 -rw-r--r--  1 ggreif  staff   61875 Mar 15 16:48 ./libraries/time/dist-
 install/build/Data/Time/Format.dyn_hi
 -rw-r--r--  1 ggreif  staff  450864 Mar 15 16:48 ./libraries/time/dist-
 install/build/Data/Time/Format.dyn_o
 -rw-r--r--  1 ggreif  staff   61863 Mar 15 16:48 ./libraries/time/dist-
 install/build/Data/Time/Format.hi
 -rw-r--r--  1 ggreif  staff  332216 Mar 15 16:48 ./libraries/time/dist-
 install/build/Data/Time/Format.o
 }}}

 With following patch applied:

 <https://github.com/ggreif/packages-
 time/commit/83f08b8896b950707a910fed4e30bddb7ee7f52f>

 I get:
 {{{
 $ ls -l ./libraries/time/dist-install/build/Data/Time/Format.*
 -rw-r--r--  1 ggreif  staff   10554 Mar 16 00:08 ./libraries/time/dist-
 install/build/Data/Time/Format.dyn_hi
 -rw-r--r--  1 ggreif  staff  106832 Mar 16 00:08 ./libraries/time/dist-
 install/build/Data/Time/Format.dyn_o
 -rw-r--r--  1 ggreif  staff   10542 Mar 16 00:08 ./libraries/time/dist-
 install/build/Data/Time/Format.hi
 -rw-r--r--  1 ggreif  staff   78864 Mar 16 00:08 ./libraries/time/dist-
 install/build/Data/Time/Format.o
 }}}
 The factor is 4.2 for Format.o, Format.dyn_o
 and 5.8 for the .hi files.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8901>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list