summaryrefslogtreecommitdiff
path: root/compiler/cmm
Commit message (Collapse)AuthorAgeFilesLines
* Support code generation for unboxed-tuple function argumentsunboxed-tuple-arguments2Max Bolingbroke2012-05-151-3/+3
| | | | | | | | | | | 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
* Cast memory primops in the C backend (#5976)Paolo Capriotti2012-05-021-16/+25
| | | | | | | To prevent conflicts with GCC builtins, generate identical code for calls to mem primos and FFI calls. Based on a patch by Joachim Breitner.
* Add a quotRemWord2 primopIan Lynagh2012-04-212-5/+7
| | | | | | | | It allows you to do (high, low) `quotRem` d provided high < d. Currently only has an inefficient fallback implementation.
* Merge remote-tracking branch 'origin/master' into type-natsIavor S. Diatchki2012-03-191-4/+5
|\
| * Fix PprC for 64bit platforms with 32bit long'sIan Lynagh2012-03-151-4/+5
| | | | | | | | e.g. Win64
* | Merge remote-tracking branch 'origin/master' into type-natsIavor S. Diatchki2012-03-1315-28/+68
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | Conflicts: compiler/coreSyn/CoreLint.lhs compiler/deSugar/DsBinds.lhs compiler/hsSyn/HsTypes.lhs compiler/iface/IfaceType.lhs compiler/rename/RnHsSyn.lhs compiler/rename/RnTypes.lhs compiler/stgSyn/StgLint.lhs compiler/typecheck/TcHsType.lhs compiler/utils/ListSetOps.lhs
| * White space onlySimon Peyton Jones2012-03-022-2/+2
| |
| * Fix the unregisterised build; fixes #5901Ian Lynagh2012-02-275-13/+28
| |
| * Change -X flags into LANGUAGE pragmasIan Lynagh2012-02-263-8/+8
| |
| * Add a 2-word-multiply operatorIan Lynagh2012-02-242-1/+3
| | | | | | | | Currently no NCGs support it
| * Add a Word add-with-carry primopIan Lynagh2012-02-239-27/+22
| | | | | | | | No special-casing in any NCGs yet
| * Add a primop for unsigned quotRem; part of #5598Ian Lynagh2012-02-173-0/+6
| | | | | | | | Only amd64 has an efficient implementation currently.
| * Define a quotRem CallishMachOp; fixes #5598Ian Lynagh2012-02-143-2/+24
| | | | | | | | | | 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).
* | Merge in more HEAD, fix stuff upSimon Peyton Jones2012-01-237-46/+60
|\ \ | |/
| * Track STG live register information for use in LLVMDavid Terei2012-01-097-46/+60
| | | | | | | | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'origin/master' into type-natsIavor S. Diatchki2012-01-077-109/+113
|\ \ | |/
| * Fix validation warningDavid Terei2012-01-051-1/+1
| |
| * Formatting fixesDavid Terei2012-01-051-47/+63
| |
| * Remove unused arg field of CmmReturnDavid Terei2012-01-056-16/+11
| |
| * Tabs -> SpacesDavid Terei2012-01-051-30/+23
| |
| * Formatting wibbleDavid Terei2012-01-051-5/+5
| |
| * Remove unused argument field on CmmJumpDavid Terei2012-01-057-17/+14
| |
| * Fix for unregisterised compilation: isStrangeTypeGlobal CCCS = TrueSimon Marlow2012-01-051-0/+2
| | | | | | | | Needed by #5357
| * Fix the C backend after making CCCS an STG registerSimon Marlow2012-01-031-0/+1
| |
* | Merge branch 'master' into type-natsIavor S. Diatchki2011-12-291-1/+1
|\ \ | |/ | | | | | | | | Conflicts: compiler/typecheck/TcCanonical.lhs compiler/typecheck/TcSMonad.lhs
| * Add a class HasDynFlags(getDynFlags)Ian Lynagh2011-12-191-1/+1
| | | | | | | | | | | | | | | | 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.
* | Remove tabs, so that I can push.Iavor S. Diatchki2011-12-181-9/+1
|/
* Remove old mangler commentDavid Terei2011-12-031-3/+0
|
* Make profiling work with multiple capabilities (+RTS -N)Simon Marlow2011-11-294-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-297-23/+20
| | | | | This field was doing nothing. I think it originally appeared in a very old incarnation of the new code generator.
* Implement a capi calling convention; fixes #2979Ian Lynagh2011-11-281-0/+1
| | | | | | | | | In GHC, this provides an easy way to call a C function via a C wrapper. This is important when the function is really defined by CPP. Requires the new CApiFFI extension. Not documented yet, as it's still an experimental feature at this stage.
* Small refactoringIan Lynagh2011-11-261-1/+1
|
* Formatting fixesDavid Terei2011-11-221-16/+16
|
* Specify unsupported ops, don't just use a catch allDavid Terei2011-11-221-13/+17
| | | | | | | | Better to specifically list the unsupported cases in code than to have a catch all that panics. The later method hides problems when new constructors are added such as the recent additions to the supported Cmm prim ops that weren't ported to the C backend since no one noticed.
* Remove registerised code for dead architectures: mips, ia64, alpha,David Terei2011-11-221-3/+0
| | | | hppa1, m68k
* Fix missing primop in PprCDavid Terei2011-11-221-2/+3
|
* Formatting of PprCDavid Terei2011-11-221-42/+41
|
* Tabs -> SpacesDavid Terei2011-11-221-175/+168
|
* Fix warnings in cmm/CmmOpt.hsIan Lynagh2011-11-051-102/+94
|
* Finish de-CPPing CmmOpt.hsIan Lynagh2011-11-053-47/+47
|
* Fix bitrotted NCG_DEBUG code, and switch to using a Haskell conditionalIan Lynagh2011-11-051-23/+22
|
* Remove some out-of-date commentsIan Lynagh2011-11-051-6/+0
|
* Clarify some commentsIan Lynagh2011-11-055-8/+11
|
* Use -fwarn-tabs when validatingIan Lynagh2011-11-0416-0/+112
| | | | | 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-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Unconditionally derive some instancesIan Lynagh2011-10-251-2/+0
| | | | They used to be only derived when DEBUG was on
* Remove some legacy codeIan Lynagh2011-10-201-11/+0
| | | | __GLASGOW_HASKELL__ >= 612 is now always true
* A little more CPP removalIan Lynagh2011-10-191-14/+15
|
* Add "have subsections via symbols" to the Platform typeIan Lynagh2011-10-191-30/+31
|
* Pass Platform to pprExpr1Ben Gamari2011-10-171-1/+1
| | | | | | | | | | | | Fixes build error: compiler/cmm/PprC.hs:961:33: Couldn't match expected type `Platform' against inferred type `CmmExpr' In the first argument of `pprExpr1', namely `expr' In the second argument of `(<+>)', namely `pprExpr1 expr' In the first argument of `parens', namely `(cast <+> pprExpr1 expr)'