summaryrefslogtreecommitdiff
path: root/compiler/codeGen
Commit message (Collapse)AuthorAgeFilesLines
* Attempt to preemptively fix bugs in the StgCmm codepathMax Bolingbroke2012-03-071-31/+29
|
* Fix remaining code generation bugs preventing stage2 GHC from workingMax Bolingbroke2012-03-072-36/+42
|
* Support code generation for unboxed-tuple function argumentsMax Bolingbroke2012-03-0630-931/+1014
| | | | | | | | | | This has the following knock-on effects: * We can remove special case code for void arguments, and treat them as nullary unboxed tuples * 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 * No VoidRep
* Fix the unregisterised build; fixes #5901Ian Lynagh2012-02-272-13/+6
|
* Implement "value" imports with the CAPIIan Lynagh2012-02-262-2/+6
| | | | | | This allows us to import values (i.e. non-functions) with the CAPI. This means we can access values even if (on some or all platforms) they are simple #defines.
* Fix generic 2-word-multiplyIan Lynagh2012-02-241-3/+3
|
* Add a 2-word-multiply operatorIan Lynagh2012-02-241-0/+48
| | | | Currently no NCGs support it
* Add a Word add-with-carry primopIan Lynagh2012-02-232-8/+58
| | | | No special-casing in any NCGs yet
* Add a primop for unsigned quotRem; part of #5598Ian Lynagh2012-02-171-0/+8
| | | | Only amd64 has an efficient implementation currently.
* Define a quotRem CallishMachOp; fixes #5598Ian Lynagh2012-02-141-0/+9
| | | | | This means we no longer do a division twice when we are using quotRem (on platforms on which the op is supported; currently only amd64).
* Port "Add new primtypes 'ArrayArray#' and 'MutableArrayArray#'" to new codegen.Edward Z. Yang2012-01-201-2/+22
| | | | | | | | 021a0dd265ff34c1e292813c06185eff1d6b5c1c appears to have only partially added the new primops associated with ArrayArray# and MutableArrayArray# Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Track STG live register information for use in LLVMDavid Terei2012-01-098-94/+127
| | | | | | | | | 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.
* Remove unused arg field of CmmReturnDavid Terei2012-01-051-1/+1
|
* Remove unused argument field on CmmJumpDavid Terei2012-01-057-13/+13
|
* Formatting fixesDavid Terei2012-01-054-526/+508
|
* Tabs -> Spaces + formatting fixesDavid Terei2012-01-052-596/+559
|
* Fixup to 4464c92badaedc45ce53d6349f6790f6d2298103Simon Marlow2012-01-052-2/+5
| | | | | | | | 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
* Rename the CCCS field of StgTSO so as not to conflict with the CCCS ↵Simon Marlow2012-01-052-2/+2
| | | | | | pseudo-register Needed by #5357
* remove dead codeSimon Marlow2012-01-041-6/+1
|
* mkSlowEntryCode: enterLocalIdLabel should be enterIdLabel (#5357)Simon Marlow2012-01-041-1/+1
|
* Add a class HasDynFlags(getDynFlags)Ian Lynagh2011-12-192-4/+4
| | | | | | | | We no longer have many separate, clashing getDynFlags functions I've given each GhcMonad its own HasDynFlags instance, rather than using UndecidableInstances to make a GhcMonad m => HasDynFlags m instance.
* Fix alignment in the CostCentre struct (#5710)Simon Marlow2011-12-192-9/+9
|
* Fix comment in CgMonadDavid Terei2011-12-111-6/+5
|
* Merge branch 'master' of http://darcs.haskell.org/ghcDavid Terei2011-12-082-4/+34
|\
| * Add new primtypes 'ArrayArray#' and 'MutableArrayArray#'Manuel M T Chakravarty2011-12-072-4/+34
| | | | | | | | | | | | | | | | The primitive array types, such as 'ByteArray#', have kind #, but are represented by pointers. They are boxed, but unpointed types (i.e., they cannot be 'undefined'). The two categories of array types —[Mutable]Array# and [Mutable]ByteArray#— are containers for unboxed (and unpointed) as well as for boxed and pointed types. So far, we lacked support for containers for boxed, unpointed types (i.e., containers for the primitive arrays themselves). This is what the new primtypes provide. Containers for boxed, unpointed types are crucial for the efficient implementation of scattered nested arrays, which are central to the new DPH backend library dph-lifted-vseg. Without such containers, we cannot eliminate all unboxing from the inner loops of traversals processing scattered nested arrays.
* | Tabs -> Spaces + FormattingDavid Terei2011-12-062-436/+402
|/
* Code generation: Always ask for result of newSparkPeter Wortmann2011-12-052-2/+5
| | | | | | | Otherwise the LLVM backend gets confused over whether its type should be "void (i8*, i8*)" or "i64 (i8*, i8*)". Signed-off-by: David Terei <davidterei@gmail.com>
* Remove dead function.David Terei2011-12-031-23/+1
|
* Merge branch 'master' of http://darcs.haskell.org/ghcIan Lynagh2011-12-022-3/+15
|\
| * More changes aimed at improving call stacks.Simon Marlow2011-12-022-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Attach a SrcSpan to every CostCentre. This had the side effect that CostCentres that used to be merged because they had the same name are now considered distinct; so I had to add a Unique to CostCentre to give them distinct object-code symbols. - New flag: -fprof-auto-calls. This flag adds an automatic SCC to every call site (application, to be precise). This is typically more useful for call stacks than annotating whole functions. Various tidy-ups at the same time: removed unused NoCostCentre constructor, and refactored a bit in Coverage.lhs. The call stack we get from traceStack now looks like this: Stack trace: Main.CAF (<entire-module>) Main.main.xs (callstack002.hs:18:12-24) Main.map (callstack002.hs:13:12-16) Main.map.go (callstack002.hs:15:21-34) Main.map.go (callstack002.hs:15:21-23) Main.f (callstack002.hs:10:7-43)
* | Move includes/DerivedConstants.h and includes/GHCConstants.h into dist dirsIan Lynagh2011-12-024-4/+4
|/ | | | | | | | | | When they existed, they were getting included in the includes_H_FILES variable (as it uses wildcard to find all header files). But the .depends files for the programs that generate the headers depend on $(includes_H_FILES), so the .depends files looked out-of-date once the headers had been created. This caused unnecessary make reinvocations. So now we put them in dist* directories, where they ought to be anyway.
* Further tweaks to the ccs primopsSimon Marlow2011-11-302-2/+16
| | | | | | | | | - add getCCSOf# :: a -> State# s -> (# State# s, Addr# #) (returns the CCS attached to the supplied object) - remove traceCcs# (obsoleted by getCCSOf#) - rename getCCCS# to getCurrentCCS#
* Add a new primop: getCCCS# :: State# s -> (# State# s, Addr# #)Simon Marlow2011-11-292-0/+5
| | | | | Returns a pointer to the current cost-centre stack when profiling, NULL otherwise.
* Make profiling work with multiple capabilities (+RTS -N)Simon Marlow2011-11-298-30/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | This means that both time and heap profiling work for parallel programs. Main internal changes: - CCCS is no longer a global variable; it is now another pseudo-register in the StgRegTable struct. Thus every Capability has its own CCCS. - There is a new built-in CCS called "IDLE", which records ticks for Capabilities in the idle state. If you profile a single-threaded program with +RTS -N2, you'll see about 50% of time in "IDLE". - There is appropriate locking in rts/Profiling.c to protect the shared cost-centre-stack data structures. This patch does enough to get it working, I have cut one big corner: the cost-centre-stack data structure is still shared amongst all Capabilities, which means that multiple Capabilities will race when updating the "allocations" and "entries" fields of a CCS. Not only does this give unpredictable results, but it runs very slowly due to cache line bouncing. It is strongly recommended that you use -fno-prof-count-entries to disable the "entries" count when profiling parallel programs. (I shall add a note to this effect to the docs).
* Get rid of the "safety" field of CmmCall (OldCmm)Simon Marlow2011-11-294-24/+18
| | | | | This field was doing nothing. I think it originally appeared in a very old incarnation of the new code generator.
* Remove a tabs kludgeIan Lynagh2011-11-261-7/+0
|
* Whitespace only in codeGen/CgForeignCall.hsIan Lynagh2011-11-261-101/+101
|
* Whitespace only in codeGen/StgCmmForeign.hsIan Lynagh2011-11-261-99/+92
|
* GHC gets a new constraint solver. More efficient and smaller in size.Dimitrios Vytiniotis2011-11-161-4/+14
|
* fix profiling bug in copyArray#/cloneArray# (cgrun068(profasm) segfault)Simon Marlow2011-11-142-2/+2
|
* Cost centre names are now in UTF-8 (#5559)Simon Marlow2011-11-072-6/+10
| | | | | | | | | So the .prof file will be UTF-8. This is mostly ok, except that the RTS doesn't calculate the column widths correctly (it assumes bytes = chars). hp2ps doesn't do anything sensible with Unicode strings, it just dumps the bytes into the .ps file.
* Allow the use of R9 and R10 in primops; fixes trac #5423Ian Lynagh2011-11-062-0/+18
|
* Give a better error for uses of R11, R12, ...; trac #5422Ian Lynagh2011-11-061-1/+5
| | | | | | It's still a panic, as it wouldn't be trivial to give a proper error at the point that we generate it, but it's now a bit nicer: Registers above R10 are not supported (tried to use R11)
* Use -fwarn-tabs when validatingIan Lynagh2011-11-0432-0/+224
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* Overhaul of infrastructure for profiling, coverage (HPC) and breakpointsSimon Marlow2011-11-0211-386/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Don't generate stg_ap thunks when profiling, it loses information (#949)Simon Marlow2011-11-022-1/+8
|
* fix warningSimon Marlow2011-10-171-1/+0
|
* make CAFs atomic, to fix #5558Simon Marlow2011-10-174-43/+42
| | | | See Note [atomic CAFs] in rts/sm/Storage.c
* Remove a little more CPPIan Lynagh2011-10-152-8/+4
|
* de-CPP codeGen/CgCon.lhsIan Lynagh2011-10-141-15/+24
|