[commit: ghc] master: Adding flags: -ffull-guard-reasoning and too-many-guards (bec5350)
git at git.haskell.org
git at git.haskell.org
Sun Dec 27 22:29:26 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/bec5350da09fde51231004b1b7d33641ac51800e/ghc
>---------------------------------------------------------------
commit bec5350da09fde51231004b1b7d33641ac51800e
Author: George Karachalias <george.karachalias at gmail.com>
Date: Sun Dec 27 23:05:02 2015 +0100
Adding flags: -ffull-guard-reasoning and too-many-guards
Introduction of two new flags, for more precise control over the new
pattern match checker's behaviour when reasoning about guards. This is
supposed to address #11195 (and maybe more performance bugs related to
the NP-Hardness of coverage checking).
Expected behaviour:
* When `-ffull-guard-reasoning` is on, run the new pattern match
checker in its full power
* When `-ffull-guard-reasoning` is off (the default), for every
match, check a metric to see whether pattern match checking for it
has high probability of being non performant (at the the moment we
check whether the number of guards is over 20 but I would like to
use a more precise measure in the future). If the probability is
high:
- Oversimplify the guards (less expressive but more performant)
and run the checker, and
- Issue a warning about the simplification that happened.
A new flag `-Wtoo-many-guards/-Wno-too-many-guards` suppresses the
warning about the simplification (useful when combined with -Werror).
Test Plan: validate
Reviewers: goldfire, austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D1676
GHC Trac Issues: #11195
>---------------------------------------------------------------
bec5350da09fde51231004b1b7d33641ac51800e
compiler/deSugar/Check.hs | 358 +++++++++++++++++-------------
compiler/deSugar/Match.hs | 26 ++-
compiler/ghci/RtClosureInspect.hs | 3 +
compiler/main/DynFlags.hs | 9 +-
compiler/nativeGen/Dwarf/Constants.hs | 4 +
compiler/types/OptCoercion.hs | 12 +-
docs/users_guide/7.12.1-notes.rst | 10 +
docs/users_guide/bugs.rst | 14 +-
docs/users_guide/using-warnings.rst | 30 +++
libraries/base/Foreign/C/Error.hs | 1 +
testsuite/tests/perf/compiler/T783.hs | 5 +
utils/mkUserGuidePart/Options/Warnings.hs | 13 ++
12 files changed, 315 insertions(+), 170 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bec5350da09fde51231004b1b7d33641ac51800e
More information about the ghc-commits
mailing list