Skip to content
  • Simon Peyton Jones's avatar
    Add a transformation limit to the simplifier (Trac #5448) · 24a2353a
    Simon Peyton Jones authored
    This addresses the rare cases where the simplifier diverges
    (see the above ticket).  We were already counting how many simplifier
    steps were taking place, but with no limit.  This patch adds a limit;
    at which point we halt compilation, and print out useful stats. The
    stats show what is begin inlined, and how often, which points you
    directly to the problem.  The limit is set based on the size of the
    program.
    
    Instead of halting compilation, we could instead just inhibit
    inlining, which would let compilation of the module complete. This is
    a bit harder to implement, and it's likely to mean that you unrolled
    the function 1143 times and then ran out of ticks; you probably don't
    want to complete parsing on this highly-unrolled program.
    
    Flags: -dsimpl-tick-factor=N.  Default is 100 (percent).
           A bigger number increases the allowed maximum tick count.
    24a2353a