| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We collect variables introduced by the {...} part of a let-like record wildcard
pattern and do not warn if the user then doesn't actually use them.
|
|
|
|
|
|
|
|
|
|
|
| |
The problem was that the codegen for foreign calls makes sure the stack
is 16-byte aligned on OS X by pushing some padding. In the case where the
foreign call is cdecl, that padding gets popped after the call, but if the
convention is stdcall then it doesn't generate any popping code at all.
However, this is incorrect because the stdcall only promises to pop the
arguments, not the padding. The fix is to generate code to pop the padding
(if any) on OS X.
|
|
|
|
|
|
| |
Converted from a darcs patch from Max Bolingbroke:
Fri Apr 1 11:39:49 BST 2011 Max Bolingbroke <batterseapower@hotmail.com>
* Really zap case-binder occurrence info: solves #5028
|
|
|
|
|
|
|
|
|
| |
We were not prioritizing the interaction of equalities in the worklist, because
pre-canonicalization solved the constraints one by one, in their arrival order.
This patch fixes this, so it's a generally useful improvement, mainly for
efficiency. It makes #4981 go away, although it's not a definite answer to the
cause of the problem. See discussion on Trac.
|
|
|
|
|
| |
This patch just puts a better SrcSpan on the AbsBinds
produced by the type checker
|
| |
|
|
|
|
| |
(See Trac #3011.)
|
|
|
|
| |
This just disables the coercion optimiser, mainly for measurements in the paper
|
|
|
|
|
| |
This dumps a (one-line) listing of the size of the Core program,
just after tidying
|
| |
|
| |
|
|
|
|
|
|
| |
This fixes a couple of duplicates that had crept in, and also
renumbers everything so that they are monotonically increasing
through the file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here's a bit of erroneous code:
00000c5c <s1ad_info>:
c5c: 8b 45 08 mov 0x8(%ebp),%eax
c5f: d9 46 03 flds 0x3(%esi)
c62: dd d9 fstp %st(1)
c64: d9 55 08 fsts 0x8(%ebp)
c67: 89 c6 mov %eax,%esi
c69: c7 45 00 24 0c 00 00 movl $0xc24,0x0(%ebp)
c70: f7 c6 03 00 00 00 test $0x3,%esi
c76: 75 ac jne c24 <s1ac_info>
So we should be doing some ffrees before the jne. The code that
inserts the ffrees wasn't expecting to do it for a conditional jump,
because they are usually local, but we have a late optimisation that
shortcuts jumps-to-jumps, and that can result in a non-local
conditional jump.
This at least fixes an instance of the bug that I was able to
reproduce, let's hope there aren't any more.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, -ddump-cmmz was used to dump out the "Raw Cmm" right
before it gets passed to the backends, as well as all of the
intermediate phases in the new code generator. Unfortunately,
there are a lot of intermediate phases, which means -ddump-cmmz
takes a very long time with -fnew-codegen for large programs,
even if you're only interested in the final result.
Here we split up -ddump-cmmz into -ddump-cmmz (now exclusively for
the new code generator) and -ddump-raw-cmm (for both code generation
paths.) The old flag was not documented in the manual, so hopefully
not too many people will be surprised by this change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When allocating new objects on the heap, we previously returned
a CmmExpr containing the heap pointer as well as the tag expression,
which would be added to the code graph upon first usage. Unfortunately,
this meant that untagged heap pointers living in registers might
be spilled to the stack, where they interacted poorly with garbage
collection (we saw this bug specifically with the compacting garbage
collector.)
This fix immediately tags the register containing the heap pointer,
so that unless we have extremely unfriendly spill code, the new pointer
will never be spilled to the stack untagged.
An alternate solution might have been to modify allocDynClosure to
tag the pointer upon the initial register allocation, but not all
invocations of allocDynClosure tag the resulting pointer, and
threading the consequent CgIdInfo for the cases that did would have
been annoying.
|
|
|
|
|
|
| |
This fixes the Lint error, but still risks leaving stupid
let { x=y } bindings in the code. But no time to fix that
today. (Leave the ticket open for that reason.)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This optimises away comparisons with minBound or maxBound
that are always false or always true.
|
| |
|
|
|
|
|
| |
Also change the behaviour slightly, to warn only for
*unqualified* imports. See Trac #4977.
|
|
|
|
|
|
|
|
|
| |
- The pragma {-# VECTORISE SCALAR foo #-} marks 'foo' as a
scalar function for for vectorisation and generates a
vectorised version by applying 'scalar_map' and friends.
- The set of scalar functions is not yet emitted into
interface files. This will be added in a subsequent
patch via 'VectInfo'.
|
|
|
|
|
|
| |
I'd failed to propagate the Opt_EnableRewriteRules flag properly,
which meant that -fno-enable-rewrite-rules didn't disable all
rewrites. This patch fixes it.
|
| |
|
|
|
|
|
|
|
| |
For some reason I'd commented out this code, which
meant that we weren't getting the the goodness of
the SPECIALISE INSTANCE pragamas in GHC.Real. And
that in turn killed performance in nofib 'power'
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch adds the script command in GHCi
A file is read and executed as a series of GHCi commands.
Execution terminates on the first error. The filename and
line number are included in the error.
|
| |
|
|
|
|
|
|
|
|
|
| |
If I had a pound for every hour Dimitrios and I have spent
making functional dependencies work right, we'd be rich!
We had stupidly caused a 'wanted' to be rewritten by a 'derived', with
resulting abject failure. As well as fixing the bug, this patch
refactors some more, adds useful assert and comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, on register-deficient architectures like x86-32,
the new code generator would emit code for calls to stg_gc_l1,
stg_gc_d1 and stg_gc_f1 that pushed their single argument on
to the stack, while the functions themselves expected the
argument to live in L1, D1 and F1 (respectively). This was
because cmmCall with the GC calling convention allocated real
registers, not virtual registers.
This patch modifies the code for assigning registers/stack slots
to use the right calling convention for GC and adds an assertion
to ensure it did it properly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added a pragma {-# VECTORISE var = exp #-} that prevents
the vectoriser from vectorising the definition of 'var'.
Instead it uses the binding '$v_var = exp' to vectorise
'var'. The vectoriser checks that the Core type of 'exp'
matches the vectorised Core type of 'var'. (It would be
quite complicated to perform that check in the type checker
as the vectorisation of a type needs the state of the VM
monad.)
- Added parts of a related VECTORISE SCALAR pragma
- Documented -ddump-vect
- Added -ddump-vt-trace
- Some clean up
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This is just a program that exploits overlapping
instances in a delicate way. The fix makes GHC
a bit more friendly towards such programs.
See Note [Overlap and deriving] in TcSimplify
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we spot an equality arising from a functional dependency,
we now use that equality (a "wanted") to rewrite the work-item
constraint right away. This avoids two dangers
Danger 1: If we send the original constraint on down the pipeline
it may react with an instance declaration, and in delicate
situations (when a Given overlaps with an instance) that
may produce new insoluble goals: see Trac #4952
Danger 2: If we don't rewrite the constraint, it may re-react
with the same thing later, and produce the same equality
again --> termination worries.
To achieve this required some refactoring of FunDeps.lhs (nicer
now!).
This patch also contains a couple of unrelated improvements
* A bad bug in TcSMonad.nestImplicTcS whereby the Tcs tyvars
of an outer implication were not untouchable inside
* Improved logging machinery for the type constraint solver;
use -ddump-cs-trace (probably with a wider default line width
-dppr-cols=200 or something)
|
|
|
|
|
|
| |
Now that exprIsDupable is less aggressive, test MethSharing wasn't
doing enough inlining. Increasing the threshold fixes the problem
but the real fix is in Trac #4960.
|
|
|
|
|
|
|
|
| |
This bug was causing a Lint error on the stable branch. For some
reason it doesn't show up in HEAD, but it's still worth fixing.
The point is that ((f `cast` co) a) is cheap if f has arity>1.
This was being gratuitously missed before.
|
|
|
|
| |
(This was part of an experiment I abandoned.)
|
|
|
|
|
|
|
|
|
| |
It turns out that exprIsDupable would return True for an expression of
*arbitrary* size, provide it was a nested bunch of applications in
which no function had more than three arguments. That was never the
intention, and could give rise to massive code duplication.
This patch makes it much less aggressive.
|
|
|
|
|
|
|
| |
The ThunkSplitting idea in WorkWrap wasn't working at all,
leading to Trac #4957. The culprit is really the simplifier
which was combining the wrong case continuations. See
Note [Fusing case continuations] in Simplify.
|
| |
|
| |
|
| |
|
| |
|