diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-04-14 09:20:42 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-04-14 09:22:00 +0100 |
commit | d261d4cbcc867405f71d7c9580628f52978e2267 (patch) | |
tree | aeb2b0c1fa7c552327e941108855f3370cd2605c /compiler/stranal | |
parent | 919b51174163907d2bc3bb41aadf56aa8bb42e9b (diff) | |
download | haskell-d261d4cbcc867405f71d7c9580628f52978e2267.tar.gz |
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.)
Diffstat (limited to 'compiler/stranal')
-rw-r--r-- | compiler/stranal/DmdAnal.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index 24ca3edd73..bf6ca7d21b 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -1116,7 +1116,7 @@ findBndrDmd :: AnalEnv -> Bool -> DmdType -> Id -> (DmdType, Demand) findBndrDmd env arg_of_dfun dmd_ty id = (dmd_ty', dmd') where - dmd' = zapDemand (ae_dflags env) $ + dmd' = killUsageDemand (ae_dflags env) $ strictify $ trimToType starting_dmd (findTypeShape fam_envs id_ty) @@ -1138,7 +1138,7 @@ findBndrDmd env arg_of_dfun dmd_ty id set_idStrictness :: AnalEnv -> Id -> StrictSig -> Id set_idStrictness env id sig - = setIdStrictness id (zapStrictSig (ae_dflags env) sig) + = setIdStrictness id (killUsageSig (ae_dflags env) sig) dumpStrSig :: CoreProgram -> SDoc dumpStrSig binds = vcat (map printId ids) |