summaryrefslogtreecommitdiff
path: root/compiler/codeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle HValues slightly nicerIan Lynagh2011-10-032-2/+2
| | | | | | We now have addrToAny# rather than addrToHValue#, and both addrToAny# and mkApUpd0# return "Any" rather than "a". This makes it a little easier to see what's going on, and fixes a warning in ByteCodeLink.
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-0210-77/+102
| | | | And some knock-on changes
* Improve the handling of Integer literalsIan Lynagh2011-09-171-1/+1
| | | | | | | | | LitInteger now carries around the id of mkInteger, which it uses to construct the core to build Integer literals. This way we don't have to build in info about lots of Ids. We also no longer have any special-casing for integer-simple, so there is less code involved.
* change how Integer's are handled in CoreIan Lynagh2011-09-131-0/+3
| | | | | | We now treat them as literals until CorePrep, when we finally convert them into the real Core representation. This makes it a lot simpler to implement built-in rules on them.
* Fix warnings in codeGen/CgUtils.hsIan Lynagh2011-09-111-38/+38
|
* Whitespace only in codeGen/CgUtils.hsIan Lynagh2011-09-111-296/+296
|
* Merge branch 'no-pred-ty'Max Bolingbroke2011-09-092-12/+0
|\ | | | | | | | | | | | | | | | | | | Conflicts: compiler/iface/BuildTyCl.lhs compiler/iface/MkIface.lhs compiler/iface/TcIface.lhs compiler/typecheck/TcTyClsDecls.lhs compiler/types/Class.lhs compiler/utils/Util.lhs
| * Implement -XConstraintKindMax Bolingbroke2011-09-062-12/+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)
* | Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2011-09-094-60/+72
|\ \ | |/
| * fix the eager-blackholing check, which I inadvertently broke inSimon Marlow2011-09-064-60/+72
| | | | | | | | | | 1c2f89535394958f75cfb15c8c5e0433a20953ed (symptom was broken biographical profiling, see #5451).
* | Wibble in tickyDynAlloc (only affects -ticky)Simon Peyton Jones2011-09-071-2/+5
|/ | | | | Fall-out from codegen refactoring, undiscovered because we don't usually build with -ticky
* fix warningSimon Marlow2011-08-251-1/+1
|
* refactoring and fixing the stage 2 compilationSimon Marlow2011-08-255-215/+153
|
* Refactoring/renamingSimon Marlow2011-08-255-87/+85
|
* get rid of the cg_rep field of CgIdInfo, which wasn't used anywhereSimon Marlow2011-08-252-5/+3
|
* eliminate ConInfoSimon Marlow2011-08-257-106/+69
|
* Remove another use of mkConInfoSimon Marlow2011-08-254-44/+41
|
* bugfix: static constructors were being given the dynamic info table pointerSimon Marlow2011-08-251-1/+1
|
* Refactoring: reduce usage of mkConInfo, with a view to killing itSimon Marlow2011-08-254-59/+87
|
* remove duplicate dumpSimon Marlow2011-08-251-2/+0
|
* avoid record selector error on closureProfSimon Marlow2011-08-252-2/+6
|
* rename LRep to ArgRepSimon Marlow2011-08-251-37/+37
|
* Renaming onlySimon Peyton Jones2011-08-256-12/+12
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* More refactoring (CgRep)Simon Peyton Jones2011-08-2515-606/+164
| | | | | | * 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-2526-1172/+559
|
* Add popCnt# primopJohan Tibell2011-08-162-0/+31
|
* Tidy up handling of PredTys: remove dead code, move functions deconstructing ↵Max Bolingbroke2011-08-032-0/+2
| | | | them to TcType
* Add Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use themSimon Peyton Jones2011-08-032-6/+6
| | | | | | These turn out to be a useful special case of splitTyConApp_maybe. A refactoring only; no change in behaviour
* Eliminate localiseLabelMax Bolingbroke2011-07-282-10/+8
|
* Eliminate infoLblToEntryLblMax Bolingbroke2011-07-282-30/+46
|
* There is only one flavour of LFBlackHole: make that explicitMax Bolingbroke2011-07-282-14/+12
|
* Put the info CLabel in CmmInfoTable rather than a localness flag, tidy up ↵Max Bolingbroke2011-07-284-27/+24
| | | | some info<->entry conversions
* Repair sanity of infoTableLabelFromCI in old code generatorMax Bolingbroke2011-07-284-27/+25
|
* More work towards cross-compilationIan Lynagh2011-07-152-2/+2
| | | | | | | | | | | | There's now a variant of the Outputable class that knows what platform we're targetting: class PlatformOutputable a where pprPlatform :: Platform -> a -> SDoc pprPlatformPrec :: Platform -> Rational -> a -> SDoc and various instances have had to be converted to use that class, and we pass Platform around accordingly.
* Fix the buildIan Lynagh2011-07-081-4/+5
| | | | | The seq# case in the new codegen was being shadowed by a more general case.
* Port 'Add two new primops seq# and spark#' (be54417) to new codegen.Edward Z. Yang2011-07-072-0/+32
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Don't export the _info symbol for the data constructor worker bindingsMax Bolingbroke2011-07-074-16/+37
| | | | | | | 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.
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-058-27/+26
| | | | | | | | | | | | | | | | | | I observed that the [CmmStatics] within CmmData uses the list in a very stylised way. The first item in the list is almost invariably a CmmDataLabel. Many parts of the compiler pattern match on this list and fail if this is not true. This patch makes the invariant explicit by introducing a structured type CmmStatics that holds the label and the list of remaining [CmmStatic]. There is one wrinkle: the x86 backend sometimes wants to output an alignment directive just before the label. However, this can be easily fixed up by parameterising the native codegen over the type of CmmStatics (though the GenCmmTop parameterisation) and using a pair (Alignment, CmmStatics) there instead. As a result, I think we will be able to remove CmmAlign and CmmDataLabel from the CmmStatic data type, thus nuking a lot of code and failing pattern matches. This change will come as part of my next patch.
* Fix Trac #5286: getPredTyDescriptionSimon Peyton Jones2011-06-302-5/+4
|
* Add two new primops:Simon Marlow2011-06-283-0/+46
| | | | | | | | | | | | | seq# :: a -> State# s -> (# State# s, a #) spark# :: a -> State# s -> (# State# s, a #) seq# is a version of seq that can be used in a State#-passing context. We will use it to implement Control.Exception.evaluate and thus fix #5129. Also we have plans to use it to fix #5262. spark# is to seq# as par is to pseq. That is, it creates a spark in a State#-passing context. We will use spark# and seq# to implement rpar and rseq respectively in an improved implementation of the Eval monad.
* codeGen: Make emitCopyByteArray less pessimisticJohan Tibell2011-06-172-19/+2
| | | | | | | | Assigning the arguments to temporaries was only needed in the case of emitCopyArray, where the arguments are alive across the call. That is not the case in emitCopyByteArray. Signed-off-by: David Terei <davidterei@gmail.com>
* Port "Add byte array copy primops" to the new code genJohan Tibell2011-06-161-0/+57
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Add byte array copy primopsJohan Tibell2011-06-161-0/+59
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Port "6c7d2a9 Use the new memcpy/memmove/memset MachOps" to new codegen.Edward Z. Yang2011-06-151-37/+23
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Use the new memcpy/memmove/memset MachOpsJohan Tibell2011-06-141-24/+25
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Remove type synonyms for CmmFormals, CmmActuals (and hinted versions).Edward Z. Yang2011-06-136-18/+18
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Port "Make array copy primops inline" and related patches to new codegen.Edward Z. Yang2011-06-135-4/+234
| | | | | | | | | | The following patches were ported: d0faaa6 Fix segfault in array copy primops on 32-bit 18691d4 Make assignTemp_ less pessimistic 9c23f06 Make array copy primops inline Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix segfault in array copy primops on 32-bitJohan Tibell2011-06-071-4/+4
| | | | | | | The second argument to C's memset was passed as a W8 while memset expects an int. Signed-off-by: David Terei <davidterei@gmail.com>
* Make assignTemp_ less pessimisticJohan Tibell2011-05-301-6/+10
| | | | | | assignTemp_ is intended to make sure that the expression gets assigned to a temporary in case that's needed in order to avoid a register getting trashed due to a function call.
* Make array copy primops inlineJohan Tibell2011-05-192-3/+228
|