Zap usage info in CSE (Trac #10218)
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 14 Apr 2015 08:20:42 +0000 (09:20 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 14 Apr 2015 08:22:00 +0000 (09:22 +0100)
commitd261d4cbcc867405f71d7c9580628f52978e2267
treeaeb2b0c1fa7c552327e941108855f3370cd2605c
parent919b51174163907d2bc3bb41aadf56aa8bb42e9b
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.)
compiler/basicTypes/Demand.hs
compiler/basicTypes/Id.hs
compiler/basicTypes/IdInfo.hs
compiler/simplCore/CSE.hs
compiler/simplCore/SetLevels.hs
compiler/stranal/DmdAnal.hs
testsuite/tests/simplCore/should_compile/EvalTest.hs
testsuite/tests/stranal/should_run/T10218.hs [new file with mode: 0644]
testsuite/tests/stranal/should_run/T10218.stdout [new file with mode: 0644]
testsuite/tests/stranal/should_run/all.T