Opened 4 years ago

Closed 6 months ago

#7782 closed task (fixed)

flag to run the demand analysis a second time

Reported by: nfrisby Owned by:
Priority: high Milestone: 8.2.1
Component: Compiler Version: 7.7
Keywords: Cc: nfrisby, nomeata
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #4941, #5302, #6087, #4962 Differential Rev(s):
Wiki Page:

Description (last modified by simonpj)

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. #10626 ? 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 4 years ago.
patch to ~ 321941a8ebe2 adding the -flate-dmd flag

Download all attachments as: .zip

Change History (20)

Changed 4 years ago by nfrisby

Attachment: late-dmd-flag.patch added

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

comment:1 Changed 4 years ago by nfrisby

Cc: nfrisby added

comment:2 Changed 4 years ago by simonpj

Description: modified (diff)
difficulty: Unknown

comment:3 Changed 4 years ago by simonpj

Description: modified (diff)

comment:4 Changed 4 years ago by simonpj

Description: modified (diff)

comment:5 Changed 4 years ago by simonpj

Description: modified (diff)

comment:6 Changed 4 years ago by simonpj

Description: modified (diff)

comment:7 Changed 4 years ago by simonpj

Description: modified (diff)

comment:8 Changed 4 years ago by nfrisby

Owner: set to nfrisby

comment:9 Changed 4 years ago by igloo

Milestone: 7.8.1

comment:10 Changed 4 years 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 4 years ago by nfrisby

Description: modified (diff)

comment:12 Changed 4 years ago by thoughtpolice

Resolution: fixed
Status: newclosed

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

comment:13 Changed 2 years ago by simonpj

Milestone: 7.8.17.12.1
Owner: nfrisby deleted
Priority: normalhigh
Resolution: fixed
Status: closednew

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 2 years ago by simonpj (previous) (diff)

comment:14 Changed 2 years 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.)

comment:15 Changed 23 months ago by simonpj

Description: modified (diff)

comment:16 Changed 21 months ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:17 Changed 18 months ago by bgamari

Milestone: 8.0.18.2.1

This won't happen for 8.0.

comment:18 Changed 6 months ago by bgamari

Cc: nomeata added

nomeata, is this perhaps addressed by f4fd98c717a7f68d76a3054021b3be65d1ebad82?

comment:19 Changed 6 months ago by nomeata

Resolution: fixed
Status: newclosed

Looks like it!

Note: See TracTickets for help on using tickets.