summaryrefslogtreecommitdiff
path: root/compiler/codeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Whitespace only in codeGen/CgCon.lhsIan Lynagh2011-10-141-205/+205
|
* Remove CPP from codeGen/StgCmmCon.hsIan Lynagh2011-10-141-21/+29
|
* Whitespace only in codeGen/StgCmmCon.hsIan Lynagh2011-10-141-62/+60
|
* 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
|