| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
Modules that need it import it themselves instead.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This roughly halves memory usage when compiling
module Foo where
foo :: Double -> Int
foo x | x == 1 = 1
...
foo x | x == 500 = 500
without optimisation.
|
|
|
|
|
|
|
| |
This allows the instance of UserOfLocalRegs to be within Haskell98, and IMHO
makes the code a little cleaner generally.
This is one small (though tedious) step towards making GHC's code more
portable...
|
| |
|
|
|
|
|
| |
This fixes building on NixOS. I'm not sure why it worked everywhere else,
but not on NixOS, before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The hs_hpc_module() prototype in RtsExternal.h didn't match its usage:
we were passing StgWord-sized parameters but the prototype used C
ints. I think it accidentally worked because we only ever passed
constants that got promoted. The constants unfortunately were
sometimes negative, which caused the C compiler to emit warnings.
I suspect PprC.pprHexVal may be wrong to emit negative constants in
the generated C, but I'm not completely sure. Anyway, it's easy to
fix this in CgHpc, which is what I've done.
|
|
|
|
| |
Fixes building with -Werror (i.e. validate) and GHC < 6.6
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've renamed a number of type and data constructors within Cmm so that
the names used in the compiler may more closely reflect the C--
specification 2.1. I've done a bit of other renaming as well.
Highlights:
CmmFormal and CmmActual now bear a CmmKind (which for now is a
MachHint as before)
CmmFormals = [CmmFormal] and CmmActuals = [CmmActual]
suitable changes have been made to both code and nonterminals in the
Cmm parser (which is as yet untested)
For reasons I don't understand, parts of the code generator use a
sequence of 'formal parameters' with no C-- kinds. For these we now
have the types
type CmmFormalWithoutKind = LocalReg
type CmmFormalsWithoutKinds = [CmmFormalWithoutKind]
A great many appearances of (Tau, MachHint) have been simplified to
the appropriate CmmFormal or CmmActual, though I'm sure there are
more opportunities.
Kind and its data constructors are now renamed to
data GCKind = GCKindPtr | GCKindNonPtr
to avoid confusion with the Kind used in the type checker and with CmmKind.
Finally, in a somewhat unrelated bit (and in honor of Simon PJ, who
thought of the name), the Whalley/Davidson 'transaction limit' is now
called 'OptimizationFuel' with the net effect that there are no longer
two unrelated uses of the abbreviation 'tx'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
The type parameter to a C-- procedure now represents a control-flow
graph, not a single instruction. The newtype ListGraph preserves the
current representation while enabling other representations and a
sensible way of prettyprinting. Except for a few changes in the
prettyprinter the new compiler binary should be bit-for-bit identical
to the old.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We used to pass the list of top-level foreign exported bindings to the
code generator so that it could create StablePtrs for them in the
stginit code. Now we don't use stginit unless profiling, and the
StablePtrs are generated by C functions marked with
attribute((constructor)). This patch removes various bits associated
with the old way of doing things, which were previously left in place
in case we wanted to switch back, I presume. Also I refactored
dsForeigns to clean it up a bit.
|
|
|
|
|
| |
This was causing us to try to jump to the address of an infotable when
unregisterised, leading to a segfault.
|
| |
|
| |
|
|
|
|
|
| |
Consistently make the type and description in the info table an offset
or a pointer, depending on whether tables are next to code or not.
|
|
|
|
|
|
| |
This patch should have no effect; it's mainly comments, layout,
plus this contructor name change.
|
|
|
|
|
|
|
|
| |
Defaulting makes compilation of multiple modules more complicated (re: #1405)
Although it was all locally within functions, not because of the module
monomorphism-restriction... but it's better to be clear what's meant, anyway.
I changed some that were defaulting to Integer, to explicit Int, where Int
seemed appropriate rather than Integer.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
* Fix code output order when printing C so things are defined before
they are used.
* Generate _ret rather than _entry functions for INFO_TABLE_RET.
* Use "ASSIGN_BaseReg" rather than "BaseReg =".
|
|
|
|
|
| |
This is needed because CgForeign and parts of the CPS pass now use
'callerSaveVolatileRegs' and not all platforms have access to the NCG.
|
|
|
|
|
|
|
|
|
|
| |
Now, if a single module *anywhere* on the module tree is built with
-fhpc, the binary will enable reading/writing of <bin>.tix.
Previously, you needed to compile Main to allow coverage to operate.
This changes the file format for .hi files; you will need to recompile every library.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We store .mix files in
.hpc/<package>/<the.module.name>.mix
The package main the empty package (aka other naming passes),
so Main just is stored in
.hpc/Main.tix
This change in backwards compatable.
|
| |
|
| |
|
|
|
|
|
| |
mapAccumL and mapAccumR are in Data.List now.
mapAccumB is unused.
|
|
|
|
| |
(This required a bit of refactoring of CmmInfo.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These include:
- Stack size detection now includes function arguments.
- Stack size detection now avoids stack checks just because of
the GC block.
- A CmmCall followed by a CmmBranch will no longer generate an extra
continuation consisting just of the brach.
- Multiple CmmCall/CmmBranch pairs that all go to the same place
will try to use the same continuation. If they can't (because
the return value signature is different), adaptor block are built.
- Function entry statements are now in a separate block.
(Fixed bug with branches to the entry block having unintended effects.)
- Other changes that I can't recall right now.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This eliminates one of the panics introduced by
the previous patch:
'First pass at implementing info tables for CPS'
The other panic introduced by that patch still remains.
It was due to the need to convert from a
ContinuationInfo to a CmmInfo.
(codeGen/CgInfoTbls.hs:emitClosureCodeAndInfoTable)
(codeGen/CgInfoTbls.hs:emitReturnTarget)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a fairly complete implementation, however
two 'panic's have been placed in the critical path
where the implementation is still a bit lacking so
do not expect it to run quite yet.
One call to panic is because we still need to create
a GC block for procedures that don't have them yet.
(cmm/CmmCPS.hs:continuationToProc)
The other is due to the need to convert from a
ContinuationInfo to a CmmInfo.
(codeGen/CgInfoTbls.hs:emitClosureCodeAndInfoTable)
(codeGen/CgInfoTbls.hs:emitReturnTarget)
|
| |
|
|
|
|
|
|
| |
This version should compile but is still incomplete as it introduces
potential bugs at the places marked 'TODO FIXME NOW'.
It is being recorded to help keep track of changes.
|
|
|
|
|
|
| |
The return values were getting put in a LocalReg
but that LocalReg needed to be stored into the enclosing
expression's return register (e.g. R1).
|
| |
|
| |
|