| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
| |
|
|
|
|
|
|
|
|
| |
See Trac #9140.
Auditors: simonpj
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Per the usual standards, a build of GHC is only compileable
by the last two releases (e.g. 7.8 only by 7.4 and 7.6). To make sure
we don't get suckered into supporting older compilers, let's remove
this support now.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan:
Try to bootstrap with GHC 7.4, watch it fail. Bootstrap
with 7.6 or better, and everything works.
Reviewers: hvr
Reviewed By: hvr
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D167
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In Linux, it is a synonym for -optl -rdynamic.
In Windows, it is a synonym for -optl -export-all-symbols.
Test Plan: validate
Reviewers: simonmar, austin
Reviewed By: simonmar, austin
Subscribers: mboes, phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D102
GHC Trac Issues: #9381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fixes ./configure --unable-unregisterised build failure:
HC [stage 1] (one of the first calls)
...
<command line>: unknown package: transformers-0.4.1.0
The reason of bug is how UNREG build stores package information
in .hc files:
compiler/main/CodeOutput.lhs generates first line as
/* GHC_PACKAGES pkg-name-ver1 pkg-name-ver2 ...
while DriverPipeline.hs (getHCFilePackages) expects
/* GHC_PACKAGES pkg-key1 pkg-key2 ...
Fix it by emitting ghc's PackageKey in CodeOutput
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested on ./configure --enable-unregistersied
Reviewers: simonmar, ezyang, austin
Reviewed By: ezyang, austin
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D164
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
1. Respect condition (a) in Note [Binder swap]
2. Respect condition (b) in Note [Binder swap]
3. Return usage of any coercion variables in binder swap
Fixes T9440
Test Plan: See #9440
Reviewers: simonpj, austin
Reviewed By: simonpj, austin
Subscribers: simonpj, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D156
GHC Trac Issues: #9440
|
|
|
|
|
|
|
|
| |
This became dead with 1e87c0a6e485e1dbef8e9ed19191e54f6cdc54e0
and was probably just missed.
I plan to re-use the freed up `mkPreludeTyConUnique 23` slot soon
for a new `bigNatTyConKey` (as part of the #9281 effort)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The two new primops with the type-signatures
resizeMutableByteArray# :: MutableByteArray# s -> Int#
-> State# s -> (# State# s, MutableByteArray# s #)
shrinkMutableByteArray# :: MutableByteArray# s -> Int#
-> State# s -> State# s
allow to resize MutableByteArray#s in-place (when possible), and are useful
for algorithms where memory is temporarily over-allocated. The motivating
use-case is for implementing integer backends, where the final target size of
the result is either N or N+1, and only known after the operation has been
performed.
A future commit will implement a stateful variant of the
`sizeofMutableByteArray#` operation (see #9447 for details), since now the
size of a `MutableByteArray#` may change over its lifetime (i.e before
it gets frozen or GCed).
Test Plan: ./validate --slow
Reviewers: ezyang, austin, simonmar
Reviewed By: austin, simonmar
Differential Revision: https://phabricator.haskell.org/D133
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We previously did a wholesale replace of `%function` to `%object` to
mangle object `.type` annotations. This is bad as it can end up
replacing appearances of `"%function"` in the user's code. We now look
for a proper `.type` keyword before performing the replacement.
Thanks to @rwbarton for pointing out the bug.
Test Plan:
Previously,
$ echo 'main = putStrLn "@function"' > test.hs
$ ghc -fllvm test.hs
$ ./test
@object
Now,
$ echo 'main = putStrLn "@function"' > test.hs
$ ghc -fllvm test.hs
$ ./test
@function
Reviewers: rwbarton, austin
Reviewed By: rwbarton, austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D150
GHC Trac Issues: #9439
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements the new primops
clz#, clz32#, clz64#,
ctz#, ctz32#, ctz64#
which provide efficient implementations of the popular
count-leading-zero and count-trailing-zero respectively
(see testcase for a pure Haskell reference implementation).
On x86, NCG as well as LLVM generates code based on the BSF/BSR
instructions (which need extra logic to make the 0-case well-defined).
Test Plan: validate and succesful tests on i686 and amd64
Reviewers: rwbarton, simonmar, ezyang, austin
Subscribers: simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D144
GHC Trac Issues: #9340
|
|
|
|
|
| |
We use fixed size signed types to e.g. represent array sizes. This
means that the size can overflow.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were two overflow issues in shouldInlinePrimOp. The first one is
due to a negative CmmInt literal being created if the array size was
given as larger than 2^63-1 (on a 64-bit platform.) This meant that
large array sizes could compare as being smaller than
maxInlineAllocSize.
The second issue is that we casted the Integer to an Int in the
comparison, which again meant that large array sizes could compare as
being smaller than maxInlineAllocSize.
The attempt to allocate a large array inline then caused a segfault.
Fixes #9416.
|
|
|
|
|
| |
This commit also removes 'KindCheckingStrategy' and related gubbins,
instead including the notion of a CUSK into HsDecls.
|
| |
|
|
|
|
|
| |
Now, a CUSK is when (and only when) all type variables are annotated.
This allows classes to participate in polymorphic recursion.
|
|
|
|
|
|
| |
Abort typechecking when we detect a superclass cycle error, as
ambiguity checking in the presence of superclass cycle errors can
cause a loop.
|
|
|
|
|
| |
This was very simple: lists of different lengths are
*maybe* apart, not *surely* apart.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The 'popcnt r16, r/m16' instruction only writes the low 16 bits of
the destination register, so we have to zero-extend the result to
a full word as popCnt16# is supposed to return a Word#.
For popCnt8# we could instead zero-extend the input to 32 bits
and then do a 32-bit popcnt, and not have to zero-extend the result.
LLVM produces the 16-bit popcnt sequence with two zero extensions,
though, and who am I to argue?
Test Plan:
- ran "make TEST=cgrun071 EXTRA_HC_OPTS=-msse42"
- then ran again adding "WAY=optasm", and verified that
the popcnt sequences we generate match the ones produced
by LLVM for its @llvm.ctpop.* intrinsics
Reviewers: austin, hvr, tibbe
Reviewed By: austin, hvr, tibbe
Subscribers: phaskell, hvr, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D147
GHC Trac Issues: #9435
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a pre-requisite for implementing count-{leading,trailing}-zero
prim-ops (re #9340) and may be useful to NCG to help turn some code into
branch-less code sequences.
Test Plan: Compiles and validates in combination with clz/ctz primop impl
Reviewers: ezyang, rwbarton, simonmar, austin
Subscribers: simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D141
|
|
|
|
|
|
|
|
|
|
|
| |
This is a pre-requisite for implementing count-{leading,trailing}-zero
prim-ops (re #9340)
Reviewers: ezyang, rwbarton, simonmar, austin
Subscribers: simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D141
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan:
- ran validate
- ran T9013 test with all ways
- ran CarryOverflow test with all ways, for good measure
Reviewers: austin, simonmar
Reviewed By: simonmar
Differential Revision: https://phabricator.haskell.org/D137
|
|
|
|
|
|
|
|
|
| |
... in preparation for backend-specific implementations.
No functional changes in this commit (except in panic messages
for ill-formed Cmm).
Differential Revision: https://phabricator.haskell.org/D138
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
No functional changes except in panic messages.
These functions were identical except for
- x87 operations in genCCall32
- the fallback to genCCall32'/64'
- "32" vs "64" in panic messages (one case was wrong!)
- minor syntactic or otherwise non-functional differences.
Test Plan:
Ran "validate --no-dph --slow" before and after the change.
Only differences were two tests that failed before the change but not after,
further investigation revealed that those tests are in fact erratic.
Reviewers: simonmar, austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D139
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Bob Ippolito <bob@redivi.com>
Test Plan: See repro instructions in trac #9189
Reviewers: austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D120
GHC Trac Issues: #9189
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested
Reviewers: austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D132
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change here is to make INCOHERENT slightly more permissive:
if the selected candidate is incoherent
then ignore all unifying candidates
This allows us to move the {-# INCOHERENT #-} pragma from
from instance Typeable (f a)
to Typeable (n:Nat) and Typable (s:Symbol)
where it belongs, and where Trac #9242 said it should be.
I don't think this will affect anyone.
I've updated the user manual.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we allocated uniques for strings starting at zero, which
means the tag bits in the unique are zero, which means that printing a
Unique for a string will start with a null byte. This is bad. So
instead, start our numbering with the tag byte as '$' (as in $tring).
This is hard coded so we don't have to worry about the optimizer
reducing the expression.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: hvr, simonmar, austin
Subscribers: simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D123
GHC Trac Issues: #9413
|
| |
|
|
|
|
|
|
|
| |
According to the definition of has_side_effets in PrimOp,
raise# clearly has side effects! In practice it makes little
difference becuase the fact that it returns bottom is more
important... but still it's better to say it right.
|
|
|
|
|
|
| |
Mainly in Simplify.rebuildCase. The old code wasn't wrong, but I kept
mis-understanding it. This patch cuts splits out "pure seq" from "strict
let", which makes it much easier to grok.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In fixing Trac #9390 I discovered that I *still* didn't really understand
what the can_fail and has_side_effects properties of a PrimOp mean, precisely.
The big new things I learned are
* has_side_effects needs to be true only of *write* effects,
Reads (which are, strictly speaking, effects) don't matter here.
* has_side_effects must be true of primops that can throw a synchronous
Haskell exception (eg raiseIO#)
* can_fail is true only of primops that can cause an *unchecked* (not
Haskell) system exception, like divide by zero, or accessing memory
out of range through an array read or write.
I've documented all this now. The changes in this patch are only
in comments.
|
|
|
|
|
|
|
|
|
| |
It's not obvious why the simplifier generates code that correctly satisfies
the let/app invariant. This patch does some minor refactoring, but the main
point is to document pre-conditions to key functions, namely that the rhs
passed in satisfies the let/app invariant.
There shouldn't be any change in behaviour.
|
|
|
|
|
|
|
|
|
| |
Vectorise.Generic.PAMethods.buildToArrPReprs was building an expression like
pvoids# (lengthSels2# sels)
which does not satisfy the let/app invariant. It should be more like
case lengthSels2# sels of l -> pvoids# l
This was caught by Core Lint (once it was taught to check for the invariant)
|
|
|
|
|
|
|
|
| |
This is actually the bug that triggered Trac #9390. We had
an unboxed tuple (# writeArray# ..., () #), and that writeArray#
argument isn't ok-for-speculation, so disobeys the invariant.
The desugaring of unboxed tuples was to blame; the fix is easy.
|
|
|
|
|
| |
We were inadvertently destroying the let/app invariant,
by floating into an unlifted function argument.
|
|
|
|
|
|
|
| |
If we have an invariant, Lint should jolly well check it.
(And indeed, adding this test throws up Lint errors that
are fixed in separate patches.)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch set adds support for extra syntax on -package and related
arguments which allow you to thin and rename modules from a package.
For example, this argument:
-package "base (Data.Bool as Bam, Data.List)"
adds two more modules into scope, Bam and Data.List, without adding
any of base's other modules to scope.
These flags are additive: so, for example, saying:
-hide-all-packages -package base -package "base (Data.Bool as Bam)"
will provide both the normal bindings for modules in base, as well as
the module Bam.
There is also a new debug flag -ddump-mod-map which prints the state
of the module mapping database. H = hidden, E = exposed (so for
example EH says the module in question is exported, but in a hidden
package.)
Module suggestions have been minorly overhauled to work better with reexports:
if you have -package "base (Data.Bool as Bam)" and mispell Bam, GHC
will suggest "Did you mean Bam (defined via package flags to be
base:Data.Bool)"; and generally you will get more accurate information.
Also, fix a bug where we suggest the -package flag when we really need
the -package-key flag.
NB: The renaming afforded here does *not* affect what wired in
symbols GHC generates. (But it does affect implicit prelude!)
ToDo: add 'hiding' functionality, to make it easier to support the alternative
prelude use-case.
ToDo: Cabal support
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: new tests and validate
Reviewers: simonpj, simonmar, hvr, austin
Subscribers: simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D113
GHC Trac Issues: #9375
|