diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-26 21:53:31 -0500 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2017-02-26 21:54:30 -0500 |
commit | 4f38fa100091152e6497db384af1fecd628e11e5 (patch) | |
tree | 0c2ab15e62ea6d9023bf6a064e807ca7b16c1f74 /compiler/main | |
parent | e4188b538bfc879b201d416cf1d68ff7072c577f (diff) | |
download | haskell-4f38fa100091152e6497db384af1fecd628e11e5.tar.gz |
Add -fspec-constr-keen
I discovered that the dramatic imprvoement in perf/should_run/T9339
with the introduction of join points was really rather a fluke, and
very fragile.
The real problem (see Note [Making SpecConstr keener]) is that
SpecConstr wasn't specialising a function even though it was applied
to a freshly-allocated constructor. The paper describes plausible
reasons for this, but I think it may well be better to be a bit more
aggressive.
So this patch add -fspec-constr-keen, which makes SpecConstr a bit
keener to specialise, by ignoring whether or not the argument
corresponding to a call pattern is scrutinised in the function body.
Now the gains in T9339 should be robust; and it might even be a
better default.
I'd be interested in what happens if we switched on -fspec-constr-keen
with -O2.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3186
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/DynFlags.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index d3d0ac34b7..442bbb984c 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -432,6 +432,7 @@ data GeneralFlag | Opt_StgCSE | Opt_LiberateCase | Opt_SpecConstr + | Opt_SpecConstrKeen | Opt_DoLambdaEtaExpansion | Opt_IgnoreAsserts | Opt_DoEtaReduction @@ -3684,6 +3685,7 @@ fFlagsDeps = [ (useInstead "enable-rewrite-rules"), flagSpec "shared-implib" Opt_SharedImplib, flagSpec "spec-constr" Opt_SpecConstr, + flagSpec "spec-constr-keen" Opt_SpecConstrKeen, flagSpec "specialise" Opt_Specialise, flagSpec "specialize" Opt_Specialise, flagSpec "specialise-aggressively" Opt_SpecialiseAggressively, |