Opened 4 years ago

Last modified 2 years ago

#10421 new bug

exponential blowup in inlining (without INLINE pragmas)

Reported by: rwbarton Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Inlining Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

The test case for #10397 also demonstrates an exponential blowup by the inliner, without any INLINE pragmas.

I added another four fields to the Register type, and I get these final Core program sizes. (The variation in sizes between versions is not really important, the point is just that they are very large for all versions.)

ghc-7.6.3:
*** CorePrep:
Result size of CorePrep
  = {terms: 1,702,684, types: 1,950,647, coercions: 103}

ghc-7.8.4:
*** CorePrep:
Result size of CorePrep
  = {terms: 1,964,183, types: 1,950,620, coercions: 97}

ghc-7.10.1:
*** CorePrep:
Result size of CorePrep
  = {terms: 1,964,212, types: 1,950,764, coercions: 97}

ghc-7.11:
*** CorePrep:
Result size of CorePrep
  = {terms: 1,964,212, types: 1,950,764, coercions: 97}

Ideally GHC should not produce enormous Core programs on its own like this.

Attachments (3)

RegBigger.hs (1.8 KB) - added by rwbarton 4 years ago.
RegBigger.hs
RegBigger2.hs (4.0 KB) - added by phadej 3 years ago.
ghc10397.tar (10.0 KB) - added by TobyGoodwin 2 years ago.
here is the missing reproducer

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by rwbarton

Attachment: RegBigger.hs added

RegBigger.hs

comment:1 Changed 4 years ago by thomie

Type of failure: None/UnknownRuntime performance bug

comment:2 Changed 3 years ago by mpickering

Keywords: Inlining added

Changed 3 years ago by phadej

Attachment: RegBigger2.hs added

comment:3 Changed 3 years ago by phadej

The code in RegBigger looks like Yesod code in trac:13253, but here we run in IO, not MForm = RWST. I checked all yesod-forms, back to http://hackage.haskell.org/package/yesod-form-0.2.0.1 released in *2011*, the MForm is RWST all the way down.

I'd close this ticket (there is trac:13253), as there is no way to reproduce using RegBigger.hs.

comment:4 Changed 3 years ago by rwbarton

I'd rather try to reconstruct the minimization that was used here, since it apparently didn't involve either transformers or INLINE pragmas.

I asked the reporter of #10397 for the original test case, but no response yet.

Changed 2 years ago by TobyGoodwin

Attachment: ghc10397.tar added

here is the missing reproducer

comment:5 Changed 2 years ago by simonpj

Thank you! Looking at the code, it looks just like #13253. Clearly something is wrong here.

Note: See TracTickets for help on using tickets.