Opened 2 years ago

Last modified 6 weeks ago

#7782 new task

flag to run the demand analysis a second time

Reported by: nfrisby Owned by:
Priority: high Milestone: 7.12.1
Component: Compiler Version: 7.7
Keywords: Cc: nfrisby
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #4941, #5302, #6087, #4962 Differential Revisions:

Description (last modified by nfrisby)

There are some tickets documenting runtime bugs that can be cleaned up by running the demand analyzer (followed by a simplifier run) a second time at the end of the pipeline: #4941, #5302, #6087. #6070 ? Others?

The -flate-dmd-anal flag has been committed to HEAD (cf comment:10 below).

The remaining task is to determine if -O2 should imply -flate-dmd-anal. It currently does not: late demand analysis is off by default.

See LateDmd for more info.

Attachments (1)

late-dmd-flag.patch (5.3 KB) - added by nfrisby 2 years ago.
patch to ~ 321941a8ebe2 adding the -flate-dmd flag

Download all attachments as: .zip

Change History (15)

Changed 2 years ago by nfrisby

patch to ~ 321941a8ebe2 adding the -flate-dmd flag

comment:1 Changed 2 years ago by nfrisby

  • Cc nfrisby added

comment:2 Changed 2 years ago by simonpj

  • Description modified (diff)
  • difficulty set to Unknown

comment:3 Changed 2 years ago by simonpj

  • Description modified (diff)

comment:4 Changed 2 years ago by simonpj

  • Description modified (diff)

comment:5 Changed 2 years ago by simonpj

  • Description modified (diff)

comment:6 Changed 2 years ago by simonpj

  • Description modified (diff)

comment:7 Changed 2 years ago by simonpj

  • Description modified (diff)

comment:8 Changed 2 years ago by nfrisby

  • Owner set to nfrisby

comment:9 Changed 2 years ago by igloo

  • Milestone set to 7.8.1

comment:10 Changed 21 months ago by Nicolas Frisby <nicolas.frisby@…>

In c080f727ba5f83921b842fcff71e9066adbdc250/ghc:

simplified the .hi format and added the -flate-dmd-anal flag (fixes #7782)

cf http://ghc.haskell.org/trac/ghc/wiki/LateDmd

comment:11 Changed 21 months ago by nfrisby

  • Description modified (diff)

comment:12 Changed 21 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from new to closed

Thanks Nicholas! I also took the time to update the ActiveBranches page.

comment:13 Changed 6 weeks ago by simonpj

  • Milestone changed from 7.8.1 to 7.12.1
  • Owner nfrisby deleted
  • Priority changed from normal to high
  • Resolution fixed deleted
  • Status changed from closed to new

I'm re-opening this because we have not yet enabled -flate-dmd-anal by default, and I think we should. But there are caveats on the LateDmd wiki page that need exploring first.

I realised this because of #10218.

Last edited 6 weeks ago by simonpj (previous) (diff)

comment:14 Changed 6 weeks ago by Simon Peyton Jones <simonpj@…>

In d261d4cbcc867405f71d7c9580628f52978e2267/ghc:

Zap usage info in CSE (Trac #10218)

Trac #10218 reports a subtle bug that turned out to be:

- CSE invalidated the usage information computed
  by earlier demand analysis, by increasing sharing

- that made a single-entry thunk into a multi-entry thunk

- and with -feager-blackholing, that led to <<loop>>

The patch fixes it by making the CSE pass zap usage information for
let-bound identifiers.   It can be restored by -flate-dmd-anal.

(But making -flate-dmd-anal the default needs some careful work;
see Trac #7782.)
Note: See TracTickets for help on using tickets.