| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was causing redundant code generation when accessors are not
actually exported, as they were being marked as "exported" at
initialization.
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Reviewed By: simonpj
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2270
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a continuation of
commit e9e61f18a548b70693f4ccd245bc56335c94b498
Date: Thu May 26 15:24:53 2016 +0100
Reduce special-casing for nullary unboxed tuple
which related to Trac #12115. But typecheck/should_run/tcrun051
revealed that my patch was incomplete.
This fixes it, by removing another special case in Type.repType.
I had also missed a case in UnariseStg.unariseIdBinder.
I took the opportunity to add explanatory notes
Note [Unarisation]
Note [Unarisation and nullary tuples]
in UnariseStg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Say we have a record like this:
data Rec = Rec
{ f1 :: Int
, f2 :: Int
, f3 :: Int
, f4 :: Int
, f5 :: Int
}
Before this patch, the code generated for `f1` looked like this:
f1_entry()
{offset
...
cJT:
_sI6::P64 = R1;
_sI7::P64 = P64[_sI6::P64 + 7];
_sI8::P64 = P64[_sI6::P64 + 15];
_sI9::P64 = P64[_sI6::P64 + 23];
_sIa::P64 = P64[_sI6::P64 + 31];
_sIb::P64 = P64[_sI6::P64 + 39];
R1 = _sI7::P64 & (-8);
Sp = Sp + 8;
call (I64[R1])(R1) args: 8, res: 0, upd: 8;
}
Note how all fields of the record are moved to local variables, even though
they're never used. These moves make it to the final assembly:
f1_info:
...
_cJT:
movq 7(%rbx),%rax
movq 15(%rbx),%rcx
movq 23(%rbx),%rcx
movq 31(%rbx),%rcx
movq 39(%rbx),%rbx
movq %rax,%rbx
andq $-8,%rbx
addq $8,%rbp
jmp *(%rbx)
With this patch we stop generating these move instructions. Cmm becomes this:
f1_entry()
{offset
...
cJT:
_sI6::P64 = R1;
_sI7::P64 = P64[_sI6::P64 + 7];
R1 = _sI7::P64 & (-8);
Sp = Sp + 8;
call (I64[R1])(R1) args: 8, res: 0, upd: 8;
}
Assembly becomes this:
f1_info:
...
_cJT:
movq 7(%rbx),%rax
movq %rax,%rbx
andq $-8,%rbx
addq $8,%rbp
jmp *(%rbx)
It turns out CmmSink already optimizes this, but it's better to generate
better code in the first place.
Reviewers: simonmar, simonpj, austin, bgamari
Reviewed By: simonmar, simonpj
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D2269
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we built the kind of a nullary unboxed tuple, we said, in
TysWiredIn.mk_tuple:
res_rep | arity == 0 = voidRepDataConTy
-- See Note [Nullary unboxed tuple] in Type
| otherwise = unboxedTupleRepDataConTy
But this is bogus. The Note deals with what the 'unarise' transformation
does, and up to that point it's simpler and more uniform to treat
nullary unboxed tuples the same as all the others.
Nicer now. And it fixes the Lint error in Trac #12115
|
|
|
|
|
|
|
|
|
| |
When faced runtime-rep-polymorphic code from a pattern-synonym
matcher, the bytecode generator was treating the result as lifted,
which it isn't. The fix is just to treat those rep-polymorphic
continuations like unlifted types, and add a dummy arg.
Trac #12007 is a case in point.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change help message so it doesn't specify -auto-all.
Make old profiling flags deprecated as they are no longer
documented.
Update Makefile and documentation accordingly.
Update release notes for ghc 8.2
Test Plan:
./verify; `ghc --help` shouldn't specify the -auto-all
flag. Furthermore `ghc -fprof -auto-all` should emit a warning
Reviewed By: thomie, austin
Differential Revision: https://phabricator.haskell.org/D2257
GHC Trac Issues: #12084
Update submodule nofib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Deriving `Typeable` has been a no-op since GHC 7.10, and now that we
require 7.10+ to build GHC, we can remove all the redundant `deriving Typeable`
statements in GHC.
Test Plan: ./validate
Reviewers: goldfire, austin, hvr, bgamari
Reviewed By: austin, hvr, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2260
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This kills two instances of varSetElems that turned out to be
nondeterministic. I've tried to untangle this before, but it's
a bit hard with the fixDs in the middle. Fortunately I now have
a test case that proves that we need determinism here.
Test Plan: ./validate, new testcase
Reviewers: simonpj, simonmar, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2258
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've changed the functions to their nonDet equivalents and explained
why they're OK there. This allowed me to remove foldNameSet,
foldVarEnv, foldVarEnv_Directly, foldVarSet and foldUFM_Directly.
Test Plan: ./validate, there should be no change in behavior
Reviewers: simonpj, simonmar, austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2244
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've also added cases for `IToparenbar` and `ITcparenbar` (aka banana
brackets) to `isUnicode`.
Document unicode TH quote alternatives (#11743)
Test Plan: ./validate
Reviewers: austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2185
GHC Trac Issues: #11743
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #11977, and #12108, rather satisfactorily
maily by deleting code!
pattern P :: Eq a => a -> a -> Int
The idea is simply /not/ to split the bit after the '=>' into the
pattern argument types, but to keep the (a->a->Int) part
un-decomposed, in the patsig_body_ty field of a TcPatSynInfo.
There is one awkward wrinkle, which is that we can't split the
implicitly-bound type variables into existential and universal until
we know which types are arguments and which are part of the result.
So we postpone the decision until we have the declaration in hand.
See TcPatSyn Note [The pattern-synonym signature splitting rule]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This appears to cause validation issues on,
TEST="T11108 T9071 T11076 T7600 T7672 T8329 T10420 T10322 T8308 T4114a
T4114c T10602 T10110 T9204 T2435 T9838 T4114d T10233 T8696 T1735 T5281
T6056 T10134 T9580 T6018 T9762 T8103"
With compiler panics of the form,
Compile failed (status 256) errors were:
ghc: panic! (the 'impossible' happened)
(GHC version 8.1.20160523 for x86_64-unknown-linux):
Binary.readBinMem: decompression failed
CallStack (from HasCallStack):
error, called at compiler/utils/Binary.hs:192:16 in ghc:Binary
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This reverts commit d9cb7a8a94daa4d20aa042cd053e20b491315633.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #12094
Test Plan: ./validate
Reviewers: austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2255
GHC Trac Issues: #12094
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2253
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deriving clauses (Ord especially) generated if-expressions with nlHsIf
which were subject to RebindableSyntax. This changes nlHsIf to generate
concrete if-expressions.
There was also an error about calling tagToEnum# at a polymorphic type,
which is not allowed. Fixing nlHsIf didn't fix this for some reason, so
I generated a type ascription around the call to tagToEnum#. Not sure
why the typechecker could not figure this out.
Test Plan: Added a test, ran validate.
Reviewers: simonpj, simonmar, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2247
GHC Trac Issues: #12080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compress all interface files generated by the compiler with LZ4. While
being only a tiny amount of code, LZ4 is both fast at compression and
decompression, and has good compression ratios.
Non-scientific size test: size of stage2 compiler .hi files:
`find ./compiler/stage2 -type f -iname '*.hi' -exec du -ch {} + | grep total$`
Without this patch: 22MB of .hi files for stage2.
With this patch: 9.2MB of .hi files for stage2.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D1159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The arrow should be printed in unicode arrow syntax when
-fprint-unicode-syntax is used.
Reviewers: austin, bgamari, thomie
Reviewed By: thomie
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2243
GHC Trac Issues: #11825
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of D1774 everything in GHC.Prim has a representation generated for it
by TcTypeable (see #11120). Unfortunately I evidently missed propagating
this change to lifted primitive types. This patch fixes this (#12082).
Test Plan: Validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2240
GHC Trac Issues: #12082
|
| |
|
| |
|
|
|
|
|
| |
The previous pretty-printer didn't account for partially
applied equalities, causing Trac #12041
|
|
|
|
|
| |
A minor parser issue, allowing a mal-formed data constructor
through.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to refactor some things to take VarSet instead of [Var],
but I think it's more precise this way.
Test Plan: ./validate
Reviewers: simonmar, simonpj, austin, bgamari, goldfire
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2227
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I haven't observed this to have an effect on nondeterminism,
but tidyOccName appears to modify the TidyOccEnv in a
way dependent on the order of inputs.
It's easy enough to change it to be deterministic to be on the
safe side.
Test Plan: ./validate
Reviewers: simonmar, austin, bgamari, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2238
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In #11555 we ended up generating references to the non-existence
stg_ap_0_upd. Here we add asserts to verify that we don't generate
references to non-existent selector or application symbols.
It would likely also make sense to add further asserts during code
generation, so we can catch the issue even closer to its source.
Test Plan: Validate
Reviewers: simonmar, austin, ezyang
Reviewed By: simonmar, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2230
GHC Trac Issues: #11155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a primitive operation to determine whether a particular
`MutableByteArray#` is backed by a pinned buffer.
Test Plan: Validate with included testcase
Reviewers: austin, simonmar
Reviewed By: austin, simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2217
GHC Trac Issues: #12059
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split out the options needed by the parser from DynFlags, making the
parser more friendly to standalone usage.
Test Plan: validate
Reviewers: simonmar, alanz, bgamari, austin, thomie
Reviewed By: simonmar, alanz, bgamari, thomie
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2208
GHC Trac Issues: #10961
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Cmm generation required to produce histograms when
compiling with -ticky flag, strips dead code from rts/Ticky.c and
reworks it to use a shared constant in both C and Haskell code.
Fixes #8308.
Test Plan: T8308
Reviewers: jstolarek, simonpj, austin
Reviewed By: simonpj
Subscribers: mpickering, simonpj, bgamari, mlen, thomie, jstolarek
Differential Revision: https://phabricator.haskell.org/D931
GHC Trac Issues: #8308
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The order inert_model and intert_eqs fold affects the order that the
typechecker looks at things. I've been able to experimentally confirm
that the order of equalities and the order of the model matter for
determinism. This is just a straigthforward replacement of
nondeterministic VarEnv for deterministic DVarEnv.
Test Plan: ./validate
Reviewers: simonpj, goldfire, austin, bgamari, simonmar
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2232
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
varEnvElts didn't introduce nondeterminism here. This makes it
obvious that it could and explains why it doesn't.
Test Plan: ./validate
Reviewers: bgamari, simonmar, austin, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2228
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
varSetElems introduces unnecessary non-determinism and while
I didn't estabilish experimentally that this matters here
I'm convinced that it will, because I expect pattern synonyms
to end up in interface files.
Test Plan: ./validate
Reviewers: austin, simonmar, bgamari, mpickering, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2206
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This creates a new package, `ghc-boot-th`, to contain the `Extension`
type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
the transitive dependency set of the `template-haskell` package remains
minimal.
The `GHC.LanguageExtensions.Type` module is also re-exported by
`ghc-boot`, which provides an orphan `binary` instance as well.
Test Plan: Validate
Reviewers: goldfire, thomie, hvr, austin
Reviewed By: thomie
Subscribers: RyanGlScott, thomie, erikd, ezyang
Differential Revision: https://phabricator.haskell.org/D2224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Printing STU was mixed up. The tab character must appear
after the 'x'.
Test Plan: validate on powerpc
Reviewers: bgamari, austin, erikd
Reviewed By: austin, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2214
GHC Trac Issues: #12054
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The type synonym expander was doing redundant work by looking at same
types again and again. This patch fixes the loop code when both of the
types can be expanded, to do `O(min(n, m))` comparisons and `O(n + m)`
expansions, where `n` is expansions of the first type and `m` is
expansions of the second type.
Reported by sjcjoosten in T10547.
Test Plan:
Added a regression test that was taking several minutes to type check
before this patch.
Reviewers: bgamari, simonpj, austin, ezyang
Reviewed By: bgamari, simonpj, austin, ezyang
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2198
GHC Trac Issues: #10547
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nondeterminism doesn't matter in these places and pprUFM makes
it obvious. I've flipped the order of arguments for convenience.
Test Plan: ./validate
Reviewers: simonmar, bgamari, austin, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2205
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need the order of specialized binds and rules to be deterministic,
so we use a deterministic set here.
Test Plan: ./validate
Reviewers: simonmar, bgamari, austin, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2197
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've changed it to use nonDetEltsUFM and documented why
it's OK.
Test Plan: it builds
Reviewers: bgamari, austin, simonmar, goldfire, simonpj
Reviewed By: simonpj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2204
GHC Trac Issues: #4012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, one can document top-level instance declarations, but derived
instances (both those in `deriving` clauses and standalone `deriving`
instances) do not enjoy the same privilege. This makes the necessary
changes to the parser to enable attaching Haddock comments for derived
instances.
Updates haddock submodule.
Fixes #11768.
Test Plan: ./validate
Reviewers: hvr, bgamari, austin
Reviewed By: austin
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2175
GHC Trac Issues: #11768
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This generalizes the `Generic1` typeclass to be of kind `k -> *`, and
this also makes the relevant datatypes and typeclasses in `GHC.Generics`
poly-kinded. If `PolyKinds` is enabled, `DeriveGeneric` derives
`Generic1` instances such that they use the most general kind possible.
Otherwise, deriving `Generic1` defaults to make an instance where the
argument is of kind `* -> *` (the current behavior).
Fixes #10604. Depends on D2117.
Test Plan: ./validate
Reviewers: kosmikus, dreixel, goldfire, austin, hvr, simonpj, bgamari
Reviewed By: simonpj, bgamari
Subscribers: thomie, ekmett
Differential Revision: https://phabricator.haskell.org/D2168
GHC Trac Issues: #10604
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When `deriveTyData` attempts to unify two kind variables (which can
happen if both the typeclass and the datatype are poly-kinded), it
mistakenly adds an extra mapping to its substitution which causes the
unification to fail when applying the substitution. This can be
prevented by checking both the domain and the range of the original
substitution to see which kind variables shouldn't be put into the
domain of the substitution. A more in-depth explanation is included in
`Note [Unification of two kind variables in deriving]`.
Fixes #11837.
Test Plan: ./validate
Reviewers: simonpj, hvr, goldfire, niteria, austin, bgamari
Reviewed By: bgamari
Subscribers: niteria, thomie
Differential Revision: https://phabricator.haskell.org/D2117
GHC Trac Issues: #11837
|