Opened 10 months ago

Last modified 8 months ago

#8319 new bug

Simplifier ticks exhausted (need -fsimpl-tick-factor=955)

Reported by: ruudkoot Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Attached file needs a rather high simpl-tick-factor (955) in order to compile.

Attachments (1)

Test.hs (2.1 KB) - added by ruudkoot 10 months ago.

Download all attachments as: .zip

Change History (3)

Changed 10 months ago by ruudkoot

comment:1 in reply to: ↑ description Changed 10 months ago by ruudkoot

$ ghc --make -O2 Test.hs

[1 of 1] Compiling Main             ( Test.hs, Test.o )

ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for x86_64-unknown-linux):
	Simplifier ticks exhausted
    When trying UnfoldingDone $w$j{v s3DM} [lid]
    To increase the limit, use -fsimpl-tick-factor=N (default 100)
    If you need to do this, let GHC HQ know, and what factor you needed
    To see detailed counts use -ddump-simpl-stats
    Total ticks: 183945
Last edited 8 months ago by simonpj (previous) (diff)

comment:2 Changed 8 months ago by simonpj

I've found out what is going on. (What follows is an aide-memoire for me.)

There is a huge function of this form:

  f = \x -> let BIG BIG BIG
            in case ... of 
                  p1 -> (# a, b, c, d #)
                  p2 -> (# a, b, c, d #)
                ...
                  p2 -> (# a, b, c, d #)

As things stand, in CoreUnfold, unboxed tuples don't count towards the size of the express, but DO count towards the result discount. See Note [Unboxed tuple size and result discount]. As a result, functions like f can be very big, but have a massive result discount, and hence can be inlined like crazy.

This blows up the size of the test program.

The obvious solution is to nuke the discount, but I need check performance runs carefully. This comment just records my progress.

Note: See TracTickets for help on using tickets.