summaryrefslogtreecommitdiff
path: root/compiler/codeGen/ClosureInfo.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old codegenSimon Marlow2012-10-191-1122/+0
| | | | | Except for CgUtils.fixStgRegisters that is used in the NCG and LLVM backends, and should probably be moved somewhere else.
* Some alpha renamingIan Lynagh2012-10-161-4/+4
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make StgWord a portable type tooIan Lynagh2012-09-181-4/+4
| | | | | StgWord is a newtyped Word64, as it needed to be something that has a UArray instance.
* Make StgHalfWord a portable typeIan Lynagh2012-09-181-8/+8
| | | | | It's now a newtyped Integer. Perhaps a newtyped Word32 would make more sense, though.
* Move tAG_BITS into platformConstantsIan Lynagh2012-09-161-9/+11
|
* Move more constants to platformConstantsIan Lynagh2012-09-161-3/+3
|
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-11/+11
|
* Pass DynFlags down to gcWordIan Lynagh2012-09-121-1/+1
|
* Pass DynFlags down to bWordIan Lynagh2012-09-121-7/+7
| | | | | | 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.
* Remove doingTickyProfilingIan Lynagh2012-09-031-1/+1
| | | | It's now just 'dopt Opt_Ticky'
* Make tablesNextToCode "dynamic"Ian Lynagh2012-08-061-19/+18
| | | | | This is a bit odd by itself, but it's a stepping stone on the way to putting "target unregisterised" into the settings file.
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-22/+25
| | | | All the flags that 'ways' imply are now dynamic
* Make -fparallel a dynamic flagIan Lynagh2012-06-201-2/+2
|
* Fix for earger blackholing of thunks with no free variables (#6146)Simon Marlow2012-06-071-1/+1
| | | | | | | | | | | | | | | | | A thunk with no free variables was not getting blackholed when -feager-blackholing was on, but we were nevertheless pushing the stg_bh_upd_frame version of the update frame that expects to see a black hole. I fixed this twice for good measure: - we now call blackHoleOnEntry when pushing the update frame to check whether the closure was actually blackholed, and so that we use the same predicate in both places - we now black hole thunks even if they have no free variables. These only occur when optimisation is off, but presumably if you say -feager-blackholing then that's what you want to happen.
* Merge remote-tracking branch 'origin/unboxed-tuple-arguments2'Paolo Capriotti2012-06-051-15/+20
|\
| * Support code generation for unboxed-tuple function argumentsunboxed-tuple-arguments2Max Bolingbroke2012-05-151-15/+20
| | | | | | | | | | | | | | | | | | | | | | 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
* | Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+1
|/ | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
* Add support for type-level "strings".Iavor S. Diatchki2012-01-241-1/+2
| | | | | | | | | | | | These are types that look like "this" and "that". They are of kind `Symbol`, defined in module `GHC.TypeLits`. For each type-level symbol `X`, we have a singleton type, `TSymbol X`. The value of the singleton type can be named with the overloaded constant `tSymbol`. Here is an example: tSymbol :: TSymbol "Hello"
* Mainly, rename LiteralTy to LitTySimon Peyton Jones2012-01-131-1/+1
|
* Merge remote-tracking branch 'origin/master' into type-natsIavor S. Diatchki2012-01-071-7/+5
|\
| * Fixup to 4464c92badaedc45ce53d6349f6790f6d2298103Simon Marlow2012-01-051-1/+4
| | | | | | | | | | | | | | | | Instead of enterLocalIdLabel we should get the label from the ClosureInfo, because that knows better whether the label should be local or not. Needed by #5357
| * remove dead codeSimon Marlow2012-01-041-6/+1
| |
* | Extend GHC's type with a representation for type level literals.Iavor S. Diatchki2011-12-181-0/+7
|/ | | | | Currently, we support only numeric literals but---hopefully---these modifications should make it fairly easy to add other ones, if necessary.
* Use -fwarn-tabs when validatingIan Lynagh2011-11-041-0/+7
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* Implement -XConstraintKindMax Bolingbroke2011-09-061-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact, this patch adds a new kind Constraint such that: Show :: * -> Constraint (?x::Int) :: Constraint (Int ~ a) :: Constraint And you can write *any* type with kind Constraint to the left of (=>): even if that type is a type synonym, type variable, indexed type or so on. The following (somewhat related) changes are also made: 1. We now box equality evidence. This is required because we want to give (Int ~ a) the *lifted* kind Constraint 2. For similar reasons, implicit parameters can now only be of a lifted kind. (?x::Int#) => ty is now ruled out 3. Implicit parameter constraints are now allowed in superclasses and instance contexts (this just falls out as OK with the new constraint solver) Internally the following major changes were made: 1. There is now no PredTy in the Type data type. Instead GHC checks the kind of a type to figure out if it is a predicate 2. There is now no AClass TyThing: we represent classes as TyThings just as a ATyCon (classes had TyCons anyway) 3. What used to be (~) is now pretty-printed as (~#). The box constructor EqBox :: (a ~# b) -> (a ~ b) 4. The type LCoercion is used internally in the constraint solver and type checker to represent coercions with free variables of type (a ~ b) rather than (a ~# b)
* fix the eager-blackholing check, which I inadvertently broke inSimon Marlow2011-09-061-33/+4
| | | | | 1c2f89535394958f75cfb15c8c5e0433a20953ed (symptom was broken biographical profiling, see #5451).
* fix warningSimon Marlow2011-08-251-1/+1
|
* refactoring and fixing the stage 2 compilationSimon Marlow2011-08-251-19/+32
|
* More refactoring (CgRep)Simon Peyton Jones2011-08-251-0/+154
| | | | | | * Move CgRep (private to old codgen) from SMRep to ClosureInfo * Avoid using CgRep in new codegen * Move SMRep and Bitmap from codeGen/ to cmm/
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-142/+32
|
* Add Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use themSimon Peyton Jones2011-08-031-3/+3
| | | | | | These turn out to be a useful special case of splitTyConApp_maybe. A refactoring only; no change in behaviour
* Eliminate localiseLabelMax Bolingbroke2011-07-281-5/+4
|
* Eliminate infoLblToEntryLblMax Bolingbroke2011-07-281-15/+23
|
* There is only one flavour of LFBlackHole: make that explicitMax Bolingbroke2011-07-281-7/+6
|
* Put the info CLabel in CmmInfoTable rather than a localness flag, tidy up ↵Max Bolingbroke2011-07-281-8/+8
| | | | some info<->entry conversions
* Repair sanity of infoTableLabelFromCI in old code generatorMax Bolingbroke2011-07-281-14/+19
|
* Don't export the _info symbol for the data constructor worker bindingsMax Bolingbroke2011-07-071-6/+16
| | | | | | | This is safe because GHC never generates a fast call to a data constructor worker: if the call is seen statically it will be eta-expanded and the allocation of the data will be inlined. We still need to export the _closure in case the constructor is used in an unapplied fashion.
* Fix Trac #5286: getPredTyDescriptionSimon Peyton Jones2011-06-301-1/+1
|
* Never jump directly to a thunk's entry code, even if it is single-entrySimon Marlow2010-03-251-10/+18
| | | | | | I don't think this fixes any bugs as we don't have single-entry thunks at the moment, but it could cause problems for parallel execution if we ever did re-introduce update avoidance.
* Trim unused imports detected by new unused-import codesimonpj@microsoft.com2009-07-061-1/+0
|
* FIX biographical profiling (#3039, probably #2297)Simon Marlow2009-03-171-0/+4
| | | | | | | | | 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).
* Make the ASSERT more informativesimonpj@microsoft.com2009-01-131-1/+1
|
* Fix warnings in ClosureInfoIan Lynagh2008-12-291-34/+43
|
* Use DynFlags to work out if we are doing ticky ticky profilingIan Lynagh2008-12-181-15/+17
| | | | We used to use StaticFlags
* Comments only (Note [Entering error thunks])simonpj@microsoft.com2008-12-051-0/+24
|
* Merging in the new codegen branchdias@eecs.harvard.edu2008-08-141-25/+27
| | | | | | | | | | | | | | | | | | 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
* Add optional eager black-holing, with new flag -feager-blackholingSimon Marlow2008-11-181-11/+1
| | | | | | | | | | | | | | | Eager blackholing can improve parallel performance by reducing the chances that two threads perform the same computation. However, it has a cost: one extra memory write per thunk entry. To get the best results, any code which may be executed in parallel should be compiled with eager blackholing turned on. But since there's a cost for sequential code, we make it optional and turn it on for the parallel package only. It might be a good idea to compile applications (or modules) with parallel code in with -feager-blackholing. ToDo: document -feager-blackholing.
* Replace ASSERT with WARN, and explain whysimonpj@microsoft.com2008-09-181-3/+30
| | | | | | | The DPH library tripped an ASSERT. The code is actually OK, but it's badly-optimised so I changed it to WARN. The issue here is explained in ClosureInfo, Note [Unsafe coerce complications].
* Fix Haddock errors.Thomas Schilling2008-07-201-1/+2
|