| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Except for CgUtils.fixStgRegisters that is used in the NCG and LLVM
backends, and should probably be moved somewhere else.
|
|
|
|
|
| |
Mostly d -> g (matching DynFlag -> GeneralFlag).
Also renamed if* to when*, matching the Haskell if/when names
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main change here is that the Cmm parser now allows high-level cmm
code with argument-passing and function calls. For example:
foo ( gcptr a, bits32 b )
{
if (b > 0) {
// we can make tail calls passing arguments:
jump stg_ap_0_fast(a);
}
return (x,y);
}
More details on the new cmm syntax are in Note [Syntax of .cmm files]
in CmmParse.y.
The old syntax is still more-or-less supported for those occasional
code fragments that really need to explicitly manipulate the stack.
However there are a couple of differences: it is now obligatory to
give a list of live GlobalRegs on every jump, e.g.
jump %ENTRY_CODE(Sp(0)) [R1];
Again, more details in Note [Syntax of .cmm files].
I have rewritten most of the .cmm files in the RTS into the new
syntax, except for AutoApply.cmm which is generated by the genapply
program: this file could be generated in the new syntax instead and
would probably be better off for it, but I ran out of enthusiasm.
Some other changes in this batch:
- The PrimOp calling convention is gone, primops now use the ordinary
NativeNodeCall convention. This means that primops and "foreign
import prim" code must be written in high-level cmm, but they can
now take more than 10 arguments.
- CmmSink now does constant-folding (should fix #7219)
- .cmm files now go through the cmmPipeline, and as a result we
generate better code in many cases. All the object files generated
for the RTS .cmm files are now smaller. Performance should be
better too, but I haven't measured it yet.
- RET_DYN frames are removed from the RTS, lots of code goes away
- we now have some more canned GC points to cover unboxed-tuples with
2-4 pointers, which will reduce code size a little.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
I've switched to passing DynFlags rather than Platform, as (a) it's
simpler to not have to extract targetPlatform in so many places, and
(b) it may be useful to have DynFlags around in future.
|
|
|
|
|
|
| |
To explicitly choose whether you want an unregisterised build you now
need to use the "--enable-unregisterised"/"--disable-unregisterised"
configure flags.
|
|
|
|
|
| |
This is a bit odd by itself, but it's a stepping stone on the way to
putting "target unregisterised" into the settings file.
|
|
|
|
| |
All the flags that 'ways' imply are now dynamic
|
|
|
|
|
|
| |
Hopefully I've kept the logic the same, and we now generate warnings if
the user does -fno-PIC but we ignore them (e.g. because they're on OS X
amd64).
|
|
|
|
|
| |
We can now get the Platform from the DynFlags inside an SDoc, so we
no longer need to pass the Platform in.
|
|
|
|
|
|
|
|
|
|
|
| |
This is done by a 'unarisation' pre-pass at the STG level which
translates away all (live) binders binding something of unboxed
tuple type.
This has the following knock-on effects:
* The subkind hierarchy is vastly simplified (no UbxTupleKind or ArgKind)
* Various relaxed type checks in typechecker, 'foreign import prim' etc
* All case binders may be live at the Core level
|
|
|
|
|
|
|
|
|
| |
We now carry around with CmmJump statements a list of
the STG registers that are live at that jump site.
This is used by the LLVM backend so it can avoid
unnesecarily passing around dead registers, improving
perfromance. This gives us the framework to finally
fix trac #4308.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
User visible changes
====================
Profilng
--------
Flags renamed (the old ones are still accepted for now):
OLD NEW
--------- ------------
-auto-all -fprof-auto
-auto -fprof-exported
-caf-all -fprof-cafs
New flags:
-fprof-auto Annotates all bindings (not just top-level
ones) with SCCs
-fprof-top Annotates just top-level bindings with SCCs
-fprof-exported Annotates just exported bindings with SCCs
-fprof-no-count-entries Do not maintain entry counts when profiling
(can make profiled code go faster; useful with
heap profiling where entry counts are not used)
Cost-centre stacks have a new semantics, which should in most cases
result in more useful and intuitive profiles. If you find this not to
be the case, please let me know. This is the area where I have been
experimenting most, and the current solution is probably not the
final version, however it does address all the outstanding bugs and
seems to be better than GHC 7.2.
Stack traces
------------
+RTS -xc now gives more information. If the exception originates from
a CAF (as is common, because GHC tends to lift exceptions out to the
top-level), then the RTS walks up the stack and reports the stack in
the enclosing update frame(s).
Result: +RTS -xc is much more useful now - but you still have to
compile for profiling to get it. I've played around a little with
adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem
quite accurately.
I plan to add more facilities for stack tracing (e.g. in GHCi) in the
future.
Coverage (HPC)
--------------
* derived instances are now coloured yellow if they weren't used
* likewise record field names
* entry counts are more accurate (hpc --fun-entry-count)
* tab width is now correct (markup was previously off in source with
tabs)
Internal changes
================
In Core, the Note constructor has been replaced by
Tick (Tickish b) (Expr b)
which is used to represent all the kinds of source annotation we
support: profiling SCCs, HPC ticks, and GHCi breakpoints.
Depending on the properties of the Tickish, different transformations
apply to Tick. See CoreUtils.mkTick for details.
Tickets
=======
This commit closes the following tickets, test cases to follow:
- Close #2552: not a bug, but the behaviour is now more intuitive
(test is T2552)
- Close #680 (test is T680)
- Close #1531 (test is result001)
- Close #949 (test is T949)
- Close #2466: test case has bitrotted (doesn't compile against current
version of vector-space package)
|
| |
|
| |
|
| |
|
|
|
|
| |
And some knock-on changes
|
|
|
|
|
| |
CmmTop -> CmmDecl
CmmPgm -> CmmGroup
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the new code generator to make use of the Hoopl package
for dataflow analysis. Hoopl is a new boot package, and is maintained
in a separate upstream git repository (as usual, GHC has its own
lagging darcs mirror in http://darcs.haskell.org/packages/hoopl).
During this merge I squashed recent history into one patch. I tried
to rebase, but the history had some internal conflicts of its own
which made rebase extremely confusing, so I gave up. The history I
squashed was:
- Update new codegen to work with latest Hoopl
- Add some notes on new code gen to cmm-notes
- Enable Hoopl lag package.
- Add SPJ note to cmm-notes
- Improve GC calls on new code generator.
Work in this branch was done by:
- Milan Straka <fox@ucw.cz>
- John Dias <dias@cs.tufts.edu>
- David Terei <davidterei@gmail.com>
Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD
and fixed a few bugs.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The type of the CmmLabel ctor is now
CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel
- When you construct a CmmLabel you have to explicitly say what
package it is in. Many of these will just use rtsPackageId, but
I've left it this way to remind people not to pretend labels are
in the RTS package when they're not.
- When parsing a Cmm file, labels that are not defined in the
current file are assumed to be in the RTS package.
Labels imported like
import label
are assumed to be in a generic "foreign" package, which is different
from the current one.
Labels imported like
import "package-name" label
are marked as coming from the named package.
This last one is needed for the integer-gmp library as we want to
refer to labels that are not in the same compilation unit, but
are in the same non-rts package.
This should help remove the nasty #ifdef __PIC__ stuff from
integer-gmp/cbits/gmp-wrappers.cmm
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Since we introduced pointer tagging, we no longer always enter a
closure to evaluate it. However, the biographical profiler relies on
closures being entered in order to mark them as "used", so we were
getting spurious amounts of data attributed to VOID. It turns out
there are various places that need to be fixed, and I think at least
one of them was also wrong before pointer tagging (CgCon.cgReturnDataCon).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This merge does not turn on the new codegen (which only compiles
a select few programs at this point),
but it does introduce some changes to the old code generator.
The high bits:
1. The Rep Swamp patch is finally here.
The highlight is that the representation of types at the
machine level has changed.
Consequently, this patch contains updates across several back ends.
2. The new Stg -> Cmm path is here, although it appears to have a
fair number of bugs lurking.
3. Many improvements along the CmmCPSZ path, including:
o stack layout
o some code for infotables, half of which is right and half wrong
o proc-point splitting
|
| |
|
|
|
|
| |
Modules that need it import it themselves instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes too numerous to comment on, but here is some old history that
I saved:
Wed Aug 15 11:07:13 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* type synonyms made consistent with new Cmm types
M ./compiler/nativeGen/MachInstrs.hs -2 +2
Mon Aug 20 19:22:14 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* pushing return info beyond cmm into codegen
M ./compiler/codeGen/Bitmap.hs r3
M ./compiler/codeGen/CgBindery.lhs r3
M ./compiler/codeGen/CgCallConv.hs r3
M ./compiler/codeGen/CgCase.lhs r3
M ./compiler/codeGen/CgClosure.lhs r3
M ./compiler/codeGen/CgCon.lhs r3
M ./compiler/codeGen/CgExpr.lhs r3
M ./compiler/codeGen/CgForeignCall.hs -6 +7 r3
M ./compiler/codeGen/CgHeapery.lhs r3
M ./compiler/codeGen/CgHpc.hs +1 r3
M ./compiler/codeGen/CgInfoTbls.hs r3
M ./compiler/codeGen/CgLetNoEscape.lhs r3
M ./compiler/codeGen/CgMonad.lhs r3
M ./compiler/codeGen/CgParallel.hs r3
M ./compiler/codeGen/CgPrimOp.hs +3 r3
M ./compiler/codeGen/CgProf.hs r3
M ./compiler/codeGen/CgStackery.lhs r3
M ./compiler/codeGen/CgTailCall.lhs r3
M ./compiler/codeGen/CgTicky.hs r3
M ./compiler/codeGen/CgUtils.hs -1 +1 r3
M ./compiler/codeGen/ClosureInfo.lhs r3
M ./compiler/codeGen/CodeGen.lhs r3
M ./compiler/codeGen/SMRep.lhs r3
M ./compiler/nativeGen/AsmCodeGen.lhs -2 +2 r1
M ./compiler/nativeGen/MachCodeGen.hs -3 +3 r1
M ./compiler/nativeGen/MachInstrs.hs r1
M ./compiler/nativeGen/MachRegs.lhs r1
M ./compiler/nativeGen/NCGMonad.hs r1
M ./compiler/nativeGen/PositionIndependentCode.hs r1
M ./compiler/nativeGen/PprMach.hs r1
M ./compiler/nativeGen/RegAllocInfo.hs r1
M ./compiler/nativeGen/RegisterAlloc.hs r1
Mon Aug 20 20:54:41 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* put CmmReturnInfo into a CmmCall (and related types)
M ./compiler/cmm/Cmm.hs -2 +1 r3
M ./compiler/cmm/CmmBrokenBlock.hs -13 +12 r1
M ./compiler/cmm/CmmCPS.hs -3 +3
M ./compiler/cmm/CmmCPSGen.hs -8 +6 r1
M ./compiler/cmm/CmmLint.hs -1 +1
M ./compiler/cmm/CmmLive.hs -1 +1
M ./compiler/cmm/CmmOpt.hs -3 +3
M ./compiler/cmm/CmmParse.y -6 +6 r3
M ./compiler/cmm/PprC.hs -3 +3
M ./compiler/cmm/PprCmm.hs -7 +4 r2
M ./compiler/codeGen/CgForeignCall.hs -7 +6 r2
M ./compiler/codeGen/CgHpc.hs -1 r1
M ./compiler/codeGen/CgPrimOp.hs -3 r1
M ./compiler/codeGen/CgUtils.hs -1 +1 r1
M ./compiler/nativeGen/AsmCodeGen.lhs -2 +2
M ./compiler/nativeGen/MachCodeGen.hs -3 +3 r1
Tue Aug 21 18:09:13 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* add call info in nativeGen
M ./compiler/nativeGen/AsmCodeGen.lhs r1
M ./compiler/nativeGen/MachInstrs.hs r1
M ./compiler/nativeGen/MachRegs.lhs r1
M ./compiler/nativeGen/NCGMonad.hs r1
M ./compiler/nativeGen/PositionIndependentCode.hs r1
M ./compiler/nativeGen/PprMach.hs r1
M ./compiler/nativeGen/RegAllocInfo.hs r1
Wed Aug 22 16:41:58 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* ListGraph is now a newtype, not a synonym
The resultant bookkeepping is unenviable, but the change
greatly simplifies our ability to make Cmm things propertly
Outputable for both list-graph and zipper-graph representations.
M ./compiler/cmm/Cmm.hs -5 +3
M ./compiler/cmm/CmmCPS.hs -2 +2
M ./compiler/cmm/CmmCPSGen.hs -1 +1
M ./compiler/cmm/CmmContFlowOpt.hs -3 +3
M ./compiler/cmm/CmmCvt.hs -2 +2
M ./compiler/cmm/CmmInfo.hs -2 +3
M ./compiler/cmm/CmmLint.hs -1 +1
M ./compiler/cmm/CmmOpt.hs -2 +2
M ./compiler/cmm/PprC.hs -1 +1
M ./compiler/cmm/PprCmm.hs -5 +8
M ./compiler/cmm/PprCmmZ.hs -7 +1
M ./compiler/codeGen/CgMonad.lhs -1 +1
M ./compiler/nativeGen/AsmCodeGen.lhs -15 +15
M ./compiler/nativeGen/MachCodeGen.hs -2 +2
M ./compiler/nativeGen/PositionIndependentCode.hs -6 +6
M ./compiler/nativeGen/PprMach.hs -3 +2
M ./compiler/nativeGen/RegAllocColor.hs +1
M ./compiler/nativeGen/RegAllocLinear.hs -4 +5
M ./compiler/nativeGen/RegCoalesce.hs -6 +6
M ./compiler/nativeGen/RegLiveness.hs -12 +12
Thu Aug 23 13:44:49 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* diagnostic assistance in case fromJust fails
M ./compiler/nativeGen/MachCodeGen.hs -2 +5
Thu Aug 23 14:07:28 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* give every block, even the first, a label
With branch-chain elimination, the first block of a procedure
might be the target of a branch. This actually happens to
a dozen or more procedures in the run-time system.
M ./compiler/nativeGen/PprMach.hs -8 +3
Fri Aug 24 17:27:04 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* clean up the code in PprMach
M ./compiler/nativeGen/PprMach.hs -16 +14
Fri Aug 24 19:35:03 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* a bunch of impedance matching to get the compiler to build, plus
* the plus is diagnostics for unreachable code, which required
moving a lot of prettyprinting code
M ./compiler/cmm/Cmm.hs -7 +5
M ./compiler/cmm/CmmCPSZ.hs -1 +1
M ./compiler/cmm/CmmCvt.hs -8 +8
M ./compiler/cmm/CmmParse.y -4 +3
M ./compiler/cmm/MkZipCfg.hs -19 +9
M ./compiler/cmm/PprCmmZ.hs -118 +4
M ./compiler/cmm/ZipCfg.hs -1 +13
M ./compiler/cmm/ZipCfgCmm.hs -10 +129
M ./compiler/main/HscMain.lhs -4 +4
M ./compiler/nativeGen/NCGMonad.hs -2 +2
M ./compiler/nativeGen/RegAllocInfo.hs -3 +3
Fri Aug 31 14:38:02 BST 2007 Norman Ramsey <nr@eecs.harvard.edu>
* fix a warning about an import
M ./compiler/nativeGen/RegAllocColor.hs -1 +1
|
| |
|
|
|
|
|
|
|
| |
Older GHCs can't parse OPTIONS_GHC.
This also changes the URL referenced for the -w options from
WorkingConventions#Warnings to CodingStyle#Warnings for the compiler
modules.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of attaching the information whether a Label is going to be
accessed dynamically or not (distinction between IdLabel/DynLabel and
additional flags in ModuleInitLabel and PlainModuleInitLabel), we hand
dflags through the CmmOpt monad and the NatM monad. Before calling
labelDynamic in PositionIndependentCode, we extract thisPackage from
dflags and supply the current package to labelDynamic, so it can take
this information into account instead of extracting it from the labels
itself. This simplifies a lot of code in codeGen that just hands
through this_pkg.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements pointer tagging as per our ICFP'07 paper "Faster
laziness using dynamic pointer tagging". It improves performance by
10-15% for most workloads, including GHC itself.
The original patches were by Alexey Rodriguez Yakushev
<mrchebas@gmail.com>, with additions and improvements by me. I've
re-recorded the development as a single patch.
The basic idea is this: we use the low 2 bits of a pointer to a heap
object (3 bits on a 64-bit architecture) to encode some information
about the object pointed to. For a constructor, we encode the "tag"
of the constructor (e.g. True vs. False), for a function closure its
arity. This enables some decisions to be made without dereferencing
the pointer, which speeds up some common operations. In particular it
enables us to avoid costly indirect jumps in many cases.
More information in the commentary:
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution/PointerTagging
|
|
|
|
|
| |
We recently discovered that they aren't a win any more, and just cost
code size.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is a start on removing import lists and generally tidying
up the top of each module. In addition to removing import lists:
- Change DATA.IOREF -> Data.IORef etc.
- Change List -> Data.List etc.
- Remove $Id$
- Update copyrights
- Re-order imports to put non-GHC imports last
- Remove some unused and duplicate imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch pushes through one fundamental change: a module is now
identified by the pair of its package and module name, whereas
previously it was identified by its module name alone. This means
that now a program can contain multiple modules with the same name, as
long as they belong to different packages.
This is a language change - the Haskell report says nothing about
packages, but it is now necessary to understand packages in order to
understand GHC's module system. For example, a type T from module M
in package P is different from a type T from module M in package Q.
Previously this wasn't an issue because there could only be a single
module M in the program.
The "module restriction" on combining packages has therefore been
lifted, and a program can contain multiple versions of the same
package.
Note that none of the proposed syntax changes have yet been
implemented, but the architecture is geared towards supporting import
declarations qualified by package name, and that is probably the next
step.
It is now necessary to specify the package name when compiling a
package, using the -package-name flag (which has been un-deprecated).
Fortunately Cabal still uses -package-name.
Certain packages are "wired in". Currently the wired-in packages are:
base, haskell98, template-haskell and rts, and are always referred to
by these versionless names. Other packages are referred to with full
package IDs (eg. "network-1.0"). This is because the compiler needs
to refer to entities in the wired-in packages, and we didn't want to
bake the version of these packages into the comiler. It's conceivable
that someone might want to upgrade the base package independently of
GHC.
Internal changes:
- There are two module-related types:
ModuleName just a FastString, the name of a module
Module a pair of a PackageId and ModuleName
A mapping from ModuleName can be a UniqFM, but a mapping from Module
must be a FiniteMap (we provide it as ModuleEnv).
- The "HomeModules" type that was passed around the compiler is now
gone, replaced in most cases by the current package name which is
contained in DynFlags. We can tell whether a Module comes from the
current package by comparing its package name against the current
package.
- While I was here, I changed PrintUnqual to be a little more useful:
it now returns the ModuleName that the identifier should be qualified
with according to the current scope, rather than its original
module. Also, PrintUnqual tells whether to qualify module names with
package names (currently unused).
Docs to follow.
|
| |
|
|
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|