summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmBuildInfoTables.hs
Commit message (Collapse)AuthorAgeFilesLines
* A panic in CmmBuildInfoTables.bundle shouldn't be a panic (#9329)Simon Marlow2014-08-011-4/+8
| | | | | | | | | | | | | | | | | Summary: This code needs more comments, but I believe this is safe. By definition I can't have broken anything that was working by turning a panic into a non-panic anyway. Test Plan: validate Reviewers: hvr, simonpj, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D105 GHC Trac Issues: #9329
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Document deprecations in HooplJan Stolarek2014-02-031-1/+1
|
* Remove redundant NoMonoLocalBinds pragmaJan Stolarek2014-02-021-5/+1
|
* Improve panic printoutSimon Peyton Jones2013-11-221-1/+2
|
* Detab modules with tabs on 5 lines or fewerIan Lynagh2013-04-061-8/+2
|
* Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-301-4/+4
| | | | | | | All Cmm procedures now include the set of global registers that are live on procedure entry, i.e., the global registers used to pass arguments to the procedure. Only global registers that are use to pass arguments are included in this list.
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* When -split-objs is on, make one SRT per split, not one per moduleSimon Marlow2012-09-251-5/+7
| | | | | This is a hopefully temporary measure until the new SRT design is implemeented.
* Misc tidyupSimon Marlow2012-09-241-8/+7
|
* Make StgWord a portable type tooIan Lynagh2012-09-181-3/+3
| | | | | StgWord is a newtyped Word64, as it needed to be something that has a UArray instance.
* Make StgHalfWord a portable typeIan Lynagh2012-09-181-3/+3
| | | | | It's now a newtyped Integer. Perhaps a newtyped Word32 would make more sense, though.
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-1/+1
|
* Move wORD_SIZE_IN_BITS to DynFlagsIan Lynagh2012-09-141-1/+1
| | | | This frees wORD_SIZE up to be moved out of HaskellConstants
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-22/+24
|
* Fix -split-objs with the new code generatorSimon Marlow2012-09-041-5/+4
| | | | | | We need to make the SRT label external and unique when splitting, because it is shared amongst all the functions in the module. Also some SRT-related cleanup.
* fix warningsSimon Marlow2012-07-301-1/+1
|
* New codegen: do not split proc-points when using the NCGSimon Marlow2012-07-301-40/+59
| | | | | | | | | Proc-point splitting is only required by backends that do not support having proc-points within a code block (that is, everything except the native backend, i.e. LLVM and C). Not doing proc-point splitting saves some compilation time, and might produce slightly better code in some cases.
* GHC 7.4 is now required for building HEADIan Lynagh2012-07-201-4/+0
|
* Refactor and simplify the SRT handlingSimon Marlow2012-07-171-65/+84
|
* Add a comment about how SRTs workSimon Marlow2012-07-171-0/+38
|
* no need to export cafTransfersSimon Marlow2012-07-171-2/+1
|
* Remove "fuel", adapt to Hoopl changes, fix warningsSimon Marlow2012-07-051-6/+5
|
* Fix merge-related problemsSimon Marlow2012-07-041-10/+2
|
* Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-07-041-20/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: (756 commits) don't crash if argv[0] == NULL (#7037) -package P was loading all versions of P in GHCi (#7030) Add a Note, copying text from #2437 improve the --help docs a bit (#7008) Copy Data.HashTable's hashString into our Util module Build fix Build fixes Parse error: suggest brackets and indentation. Don't build the ghc DLL on Windows; works around trac #5987 On Windows, detect if DLLs have too many symbols; trac #5987 Add some more Integer rules; fixes #6111 Fix PA dfun construction with silent superclass args Add silent superclass parameters to the vectoriser Add silent superclass parameters (again) Mention Generic1 in the user's guide Make the GHC API a little more powerful. tweak llvm version warning message New version of the patch for #5461. Fix Word64ToInteger conversion rule. Implemented feature request on reconfigurable pretty-printing in GHCi (#5461) ... Conflicts: compiler/basicTypes/UniqSupply.lhs compiler/cmm/CmmBuildInfoTables.hs compiler/cmm/CmmLint.hs compiler/cmm/CmmOpt.hs compiler/cmm/CmmPipeline.hs compiler/cmm/CmmStackLayout.hs compiler/cmm/MkGraph.hs compiler/cmm/OldPprCmm.hs compiler/codeGen/CodeGen.lhs compiler/codeGen/StgCmm.hs compiler/codeGen/StgCmmBind.hs compiler/codeGen/StgCmmLayout.hs compiler/codeGen/StgCmmUtils.hs compiler/main/CodeOutput.lhs compiler/main/HscMain.hs compiler/nativeGen/AsmCodeGen.lhs compiler/simplStg/SimplStg.lhs
| * Remove some uses of sortLeIan Lynagh2012-06-221-1/+1
| | | | | | | | | | | | Technically the behaviour of sortWith has changed, as it used x `le` y = get_key x < get_key y (note "<" rather than "<="), but I assume that that was just a mistake.
| * Remove some unnecessary platform argumentsIan Lynagh2012-06-131-11/+9
| |
| * Remove PlatformOutputableIan Lynagh2012-06-131-5/+5
| | | | | | | | | | We can now get the Platform from the DynFlags inside an SDoc, so we no longer need to pass the Platform in.
| * Change how macros like ASSERT are definedIan Lynagh2012-06-051-1/+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.
| * Change -X flags into LANGUAGE pragmasIan Lynagh2012-02-261-3/+3
| |
* | take the analyses out of the FuelUniqSM monadSimon Marlow2012-03-151-1/+1
| |
* | Remove the old stack layout algorithmsSimon Marlow2012-03-151-1/+0
| | | | | | | | | | | | | | | | Also, do removeDeadAssignments instead of cmmLiveness before stack allocation, because the former also does liveness analysis, and we can do just one liveness analysis instead of two. The stack layout algorithm doesn't introduce any dead assignments, so this doesn't affect the generated code.
* | Lower safe foreign calls in the new CmmLayoutStackSimon Marlow2012-03-061-89/+0
| | | | | | | | | | | | | | | | We also generate much better code for safe foreign calls (and maybe also unsafe foreign calls) than previously. See the two new Notes: Note [lower safe foreign calls] Note [safe foreign call convention]
* | tiny refactoringSimon Marlow2012-02-141-2/+1
| |
* | Build info tables with the new stack layout codeSimon Marlow2012-02-081-116/+1
| |
* | New stack layout algorithmSimon Marlow2012-02-081-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Also: - improvements to code generation: push slow-call continuations on the stack instead of generating explicit continuations - remove unused CmmInfo wrapper type (replace with CmmInfoTable) - squash Area and AreaId together, remove now-unused RegSlot - comment out old unused stack-allocation code that no longer compiles after removal of RegSlot
* | Run the complete backend (Stg -> .S) incrementally on each StgBindingSimon Marlow2012-01-261-5/+11
| | | | | | | | | | | | | | | | | | This is so that we can process the Stg code in constant space. Before we were generating all the C-- up front, leading to a large space leak. I haven't converted the LLVM or C back ends to the incremental scheme, but it's not hard to do.
* | Use Set instead of Map for CAFSetSimon Marlow2012-01-251-20/+22
| |
* | tiny refactoringSimon Marlow2012-01-191-1/+1
| |
* | SnapshotSimon Marlow2012-01-171-2/+2
|/
* Clarify some commentsIan Lynagh2011-11-051-3/+3
|
* 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.
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-021-12/+18
| | | | And some knock-on changes
* refactoring and fixing the stage 2 compilationSimon Marlow2011-08-251-2/+2
|
* Renaming onlySimon Peyton Jones2011-08-251-12/+12
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-25/+27
|
* Don't export the _info symbol for the data constructor worker bindingsMax Bolingbroke2011-07-071-3/+3
| | | | | | | 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-051-2/+2
| | | | | | | | | | | | | | | | | | 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.
* Merge in new code generator branch.Simon Marlow2011-01-241-221/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | This changes the new code generator to make use of the Hoopl package for dataflow analysis. Hoopl is a new boot package, and is maintained in a separate upstream git repository (as usual, GHC has its own lagging darcs mirror in http://darcs.haskell.org/packages/hoopl). During this merge I squashed recent history into one patch. I tried to rebase, but the history had some internal conflicts of its own which made rebase extremely confusing, so I gave up. The history I squashed was: - Update new codegen to work with latest Hoopl - Add some notes on new code gen to cmm-notes - Enable Hoopl lag package. - Add SPJ note to cmm-notes - Improve GC calls on new code generator. Work in this branch was done by: - Milan Straka <fox@ucw.cz> - John Dias <dias@cs.tufts.edu> - David Terei <davidterei@gmail.com> Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD and fixed a few bugs.
* Remove code that is dead now that we need >= 6.12 to buildIan Lynagh2010-12-151-2/+0
|