| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The implementation plan is all in Note [Detecting forced eta expansion]
in DsExpr.
|
|
|
|
|
|
|
| |
The change is noted in Note [Given in ctEvCoercion]. This patch
also adds a bit more commentary to TcFlatten, documenting some
key invariants of the flattening algorithm. While in the area,
I also removed some stale commentary from TcCanonical.
|
|
|
|
|
|
|
| |
Previously, mkCastTy went to great lengths to shove casts
around. But this doesn't seem to be necessary. However,
the reflexivity check currently in mkCastTy is not enough.
See the abortive Note [No reflexive casts in types]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation plan is all in Note [Detecting forced eta expansion]
in DsExpr.
Test Plan: ./validate, codeGen/should_fail/T13233
Reviewers: simonpj, austin, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13233
Differential Revision: https://phabricator.haskell.org/D3490
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug, reported in Trac #13623 has been present since
commit b8b3e30a6eedf9f213b8a718573c4827cfa230ba
Author: Edward Z. Yang <ezyang@cs.stanford.edu>
Date: Fri Jun 24 11:03:47 2016 -0700
Axe RecFlag on TyCons.
SpecConstr tries not to specialise indefinitely, and had a
limit (see Note [Limit recursive specialisation]) that made
use of info about whether or not a data constructor was
"recursive". This info vanished in the above commit, making
the limit fire much more often -- and indeed it fired in this
test case, in a situation where specialisation is /highly/
desirable.
I refactored the test, to look instead at the number of
iterations of the loop of "and now specialise calls that
arise from the specialisation". Actually less code, and
more robust.
I also added record field names to a couple of constructors,
and renamed RuleInfo to SpecInfo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit has a raft of refactorings that improve the treatment
of join points. I wasn't aiming so much as to gain performance as
to make the code simpler.
The two big things are these:
* Make mkDupableCont work for SimplBind as well. This is simpler than
I thought and quite neat. (Luke had aready done StrictArg.) That's
a win in its own right. But also now /all/ continuations can be made
dup-able
* Now that all continuations can be made dup-able, I could simplify
mkDupableCont to return just one SimplCont, instead of two.
That really is a worthwhile simlification! Much easier to think
about.
Plus a bunch of smaller things:
* Remove the join-arity that had been added to seIdSubst.
It can be done more simply by putting it in DoneEx, which
is the only constructor that actually needs it, and now we
don't need the unsavoury isJoinIdInEnv_maybe.
* Re-order the handling of join points in Simplify, so that we don't need
the horrible resultTypeOfDupableCont
* Add field names for StrictBind, StrictArg; and use them
* Define simplMonad.newJoinId, and use it
* Rename the seFloats field of SimplEnv to seLetFloats
Binary sizes seem to go up slightly, but allocations generally
improve, sometimes significantly. I don't believe the runtime numbers
are reliable enough to draw any conclusions about
--------------------------------------------------------------------------------
Program Size Allocs Runtime Elapsed TotalMem
--------------------------------------------------------------------------------
event +1.1% -12.0% -0.2% -0.2% -8.7%
fulsom +1.9% -11.8% -10.0% -10.0% +5.3%
last-piece +2.3% -1.2% -1.2% -1.2% +0.0%
mate +0.9% -1.4% -0.6% -0.7% +0.0%
multiplier +1.5% -8.3% 0.17 0.17 +0.0%
parser +2.0% +1.0% 0.04 0.04 +0.0%
parstof +1.5% +0.7% 0.01 0.01 +0.0%
sched +1.3% -6.1% 0.03 0.03 +0.0%
simple +1.8% +1.0% +9.7% +9.6% +0.0%
--------------------------------------------------------------------------------
Min +0.5% -12.0% -10.0% -10.0% -8.7%
Max +3.0% +1.0% +14.2% +14.2% +50.0%
Geometric Mean +1.4% -0.4% +0.3% +0.4% +0.5%
There's also a tests/perf/compiler improvement of 20% allocation in
T6048. I think it's because we now generate smaller code.
|
|
|
|
|
|
|
|
|
|
| |
This seems to have regressed due to,
commit 5c602d2228d28530621cc6c94fbb736b13f474fb
Author: Reid Barton <rwbarton@gmail.com>
Date: Mon May 1 11:17:47 2017 -0400
Avoid excessive space usage from unfoldings in CoreTidy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
GHC Trac Issues: #13564
Differential Revision: https://phabricator.haskell.org/D3516
|
|
|
|
| |
I had meant to do this before merging but forgot.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See Note [Scrutinee Constant Folding] in SimplUtils
* Add cases for tagToEnum and dataToTag. This is the main new
bit. It allows the simplifier to remove the pervasive uses
of case tagToEnum (a > b) of
False -> e1
True -> e2
and replace it by the simpler
case a > b of
DEFAULT -> e1
1# -> e2
See Note [caseRules for tagToEnum]
and Note [caseRules for dataToTag] in PrelRules.
* This required some changes to the API of caseRules, and hence
to code in SimplUtils. See Note [Scrutinee Constant Folding]
in SimplUtils.
* Avoid duplication of work in the (unusual) case of
case BIG + 3# of b
DEFAULT -> e1
6# -> e2
Previously we got
case BIG of
DEFAULT -> let b = BIG + 3# in e1
3# -> let b = 6# in e2
Now we get
case BIG of b#
DEFAULT -> let b = b' + 3# in e1
3# -> let b = 6# in e2
* Avoid duplicated code in caseRules
A knock-on refactoring:
* Move Note [Word/Int underflow/overflow] to Literal, as
documentation to accompany mkMachIntWrap etc; and get
rid of PrelRuls.intResult' in favour of mkMachIntWrap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out we were using two different sets of type variables when
reifying data family instances in Template Haskell. We were using the
tyvars quantifying over the instance itself for the LHS, but using the
tyvars quantifying over the data family instance constructor for the
RHS. This commit uses the instance tyvars for both the LHS and the RHS,
fixing #13618.
Test Plan: make test TEST=T13618
Reviewers: goldfire, austin, bgamari
Reviewed By: goldfire, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13618
Differential Revision: https://phabricator.haskell.org/D3505
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 2f9f1f86849ebc18af409c9b3fd809c9cd464021
(#13487) fixes #12104 as well. This adds a regression test for the
program reported in #12104 to keep it fixed.
Test Plan: make test TEST=T12104
Reviewers: bgamari, austin
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #12104
Differential Revision: https://phabricator.haskell.org/D3495
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we see f (g x), and f is strict, we want to be a bit more eager to
inline g, because it may well expose an eval (on x perhaps) that can
be eliminated or shared.
I saw this in nofib boyer2, function RewriteFuns.onewayunify1. It
showed up as a consequence of the preceding patch that makes the
simplifier do less work (Trac #13379). We had
f d (g x)
where f was a class-op. Previously we simplified both d and
(g x) with a RuleArgCtxt (making g a bit more eager to inline).
But now we simplify only d that way, then fire the rule, and
only then simplify (g x). Firing the rule produces a strict
funciion, so we want to make a strict function encourage
inlining a bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch nails a Bad Bug exposed in Trac #13379. Roughly,
a deeply-nested application like
f (f (f ....) ) )
could make the simplifier go exponential -- without producing
an exponential-sized result!
The reason was that we
- simplified a (big) function argument
- then decided to inline the function
- then preInilneUnconditionally the argument
- and then re-simplified the big argument
And if the "big argument" itself had a similar structure
things could get very bad.
Once I'd understood, it was easy to fix:
* See Note Note [Avoiding exponential behaviour] for an overview
* The key change is that Simplify.simplLam now as a case for
(isSimplified dup). This is what removes the perf bug.
* But I also made simplCast more parsimonious about simplifying,
avoiding doing so when the coercion is Refl
* And similarly I now try to avoid simplifying arguments
where possible before applying rules.
See Note [Trying rewrite rules]
The latter two points tackle common cases, and in those cases make the
simplifier take fewer iterations.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: bgamari, austin
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we were unconditionally pretty-printing all type variable
binders when pretty-printing closed type families (e.g., in the output
of `:info` in GHCi). This threw me for a loop, so let's guard this behind
the `-fprint-explicit-foralls` flag.
Test Plan: make test TEST=T13420
Reviewers: goldfire, austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13420
Differential Revision: https://phabricator.haskell.org/D3497
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
setProgramDynFlags invalidates the whole module graph, forcing
everything to be re-summarised (including preprocessing) on every
:reload.
Looks like this was a bad regression in 8.0, but we didn't notice
because there was no test for it. Now there is!
Test Plan:
* validate
* new unit test
Reviewers: bgamari, triple, austin, niteria, erikd, jme
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3398
|
|
|
|
| |
this program should be rejected, but is not (and segfaults).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously rmtree's error callback would throw an exception, breaking
out of the retry loop.
Test Plan: Validate on Windows
Reviewers: Phyx, austin
Reviewed By: Phyx
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3492
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Commit b207b536ded40156f9adb168565ca78e1eef2c74 (#11714) happened to
fix #13603 as well. Let's add a regression test so that it stays fixed.
Test Plan: make test TEST=T13603
Reviewers: bgamari, austin, simonpj
Reviewed By: bgamari, simonpj
Subscribers: simonpj, rwbarton, thomie
GHC Trac Issues: #13603
Differential Revision: https://phabricator.haskell.org/D3489
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate
Reviewers: austin
Subscribers: rwbarton, thomie
GHC Trac Issues: #13587
Differential Revision: https://phabricator.haskell.org/D3474
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin
Subscribers: rwbarton, thomie
GHC Trac Issues: #13591
Differential Revision: https://phabricator.haskell.org/D3470
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The conclusion of #13555 was that a program which began to fail to
typecheck (starting in GHC 8.2) was never correct to begin with. Let's
document why this is the case with respect to `MonoLocalBinds`'
interaction with kind generalization. Also adds the reported program as
a `compile_fail` testcase.
Test Plan: make test TEST=T13555 # Also, read the docs
Reviewers: goldfire, simonpj, austin, bgamari
Reviewed By: goldfire, simonpj, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13555
Differential Revision: https://phabricator.haskell.org/D3472
|
| |
|
|
|
|
|
|
|
| |
This test has been occassionally failing on the Darwin build bot for some time
now.
(cherry picked from commit b3a4dd1152884ff1240824137eca0a49cb6e5a2c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 74615f412ad3de2910a156ff494bfe5497fada7e
("UNREG: ignore -fllvm (Trac #13495)") enabled
'optllvm' tests to be ran in 'make fulltest' mode.
As a result many (~1000) tests fail due to stderr misamatch:
+when making flags consistent: warning:
+ Compiler unregisterised, so compiling via C
The change removes 'optllvm' tests for unregisterised compiler.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
| |
as proposed in #13588.
Differential Revision: https://phabricator.haskell.org/D3467
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari, dfeuer
Reviewed By: bgamari, dfeuer
Subscribers: rwbarton, thomie
GHC Trac Issues: #13392
Differential Revision: https://phabricator.haskell.org/D3461
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before ghc-7.2 hs_add_root() had to be used to initialize haskell
modules when haskell was called from FFI.
commit a52ff7619e8b7d74a9d933d922eeea49f580bca8
("Change the way module initialisation is done (#3252, #4417)")
removed needs for hs_add_root() and made function a no-op.
For backward compatibility '__stginit_<module>' symbol was
not removed.
This change removes no-op hs_add_root() function and unused
'__stginit_<module>' symbol from each haskell module.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: ./validate
Reviewers: simonmar, austin, bgamari, erikd
Reviewed By: simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3460
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The proximate cause for this patch is Trac #13482, which pointed out
further subtle interactions between
- Inferring the most general type of a function
- A partial type signature for that function
That led me into /further/ changes to the shiny new stuff in
TcSimplify.simplifyInfer, decideQuantification, decideMonoTyVars,
and related functions.
Happily, I was able to make some of it quite a bit simpler,
notably the bit about promoting free tyvars. I'm happy with
the result.
Moreover I fixed Trac #13524 at the same time. Happy days.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When doing this I noticed a horrible amount of duplication between
lookupSubBndrOcc and lookupExportChild (which I am responsible for).
I opened #13545 to keep track of this.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13528
Differential Revision: https://phabricator.haskell.org/D3434
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Test on x86 and x86_64
Reviewers: duncan, trofi, simonmar, tibbe, hvr, austin, rwbarton,
bgamari
Reviewed By: duncan
Subscribers: Phyx, DemiMarie, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3358
|
| |
|
|
|
|
|
|
|
|
|
| |
I realised (Trac #13543) that we can improve demand analysis for
join point quite straightforwardly.
The idea is explained in
Note [Demand analysis for join points]
in DmdAnal
|
| |
|
|
|
|
| |
which counts allocations instead of observing recomputation directly.
|
|
|
|
|
|
|
|
|
| |
as they might be marked as one-shot, and suddenly we’d evaluate them
multiple times. This came up in #13536 (test cases included).
The solution was layed out by SPJ in ticket:13536#comment:12.
Differential Revision: https://phabricator.haskell.org/D3437
|
|
|
|
|
|
|
| |
Fix a regression in the pretty-printed code for -ddump-splices, which regressed
since 8.0.
Closes trac issue #13550
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #13468, and at the same time makes the
code simpler and more uniform. In particular, I've eliminated
the awkward conflict between the old built-in rule for seq
(which elimianted a cast), and the desire to make case scrutinse
a data type by doing type-family reduction (which adds a cast).
Nice.
|
|
|
|
|
|
| |
The Harbormaster build seems to slightly disagree with my local build machine on
a few of these. In the case of `haddock.compiler` the difference is nearly an
order of magnitude. Odd.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 2b64e926a628fb2a3710b0360123ea73331166fe (#13135) ended
up fixing #13538 as well. Let's add a regression test so that it stays
fixed.
Test Plan: make test TEST=T13538
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13538
Differential Revision: https://phabricator.haskell.org/D3426
|
|
|
|
|
|
|
|
|
|
| |
In the implementation of WarnSimplifiableClassConstraints, be
less aggressive about reporting a problem. We were complaining
about a "fragile" case that in fact was not fragile.
See Note [Simplifiable given constraints] in TcValidity.
This fixes Trac #13526.
|