summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmPipeline.hs
Commit message (Collapse)AuthorAgeFilesLines
* update commentSimon Marlow2014-08-011-4/+3
|
* Don't use showPass in the backend (#8973)Simon Marlow2014-06-081-2/+0
|
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-0/+2
| | | | | | | | | | | | | | | | | | 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.
* Eliminate duplicate code in Cmm pipelineJan Stolarek2014-02-031-51/+30
| | | | | | | | | End of Cmm pipeline used to be split into two alternative flows, depending on whether we did proc-point splitting or not. There was a lot of code duplication between these two branches. But it wasn't really necessary as the differences can be easily enclosed within an if-then-else. I observed no impact of this change on compilation performance.
* Remove unnecessary LANGUAGE pragmaJan Stolarek2014-02-011-5/+0
|
* -ddump-cmm: don't dump the proc point stage if we didn't do anythingSimon Marlow2013-11-281-3/+6
|
* Add debug dump of the list of Cmm proc pointsSimon Peyton Jones2013-11-221-0/+1
|
* Rename -ddump-cmm-rewrite to -ddump-cmm-sinkJan Stolarek2013-09-131-1/+1
| | | | This makes it consistent with the corresponding -cmm-sink flag
* Improve sinking passJan Stolarek2013-09-121-10/+130
| | | | | | | | | | | | | | | | | | | | This commit does two things: * Allows duplicating of global registers and literals by inlining them. Previously we would only inline global register or literal if it was used only once. * Changes method of determining conflicts between a node and an assignment. New method has two advantages. It relies on DefinerOfRegs and UserOfRegs typeclasses, so if a set of registers defined or used by a node should ever change, `conflicts` function will use the changed definition. This definition also catches more cases than the previous one (namely CmmCall and CmmForeignCall) which is a step towards making it possible to run sinking pass before stack layout (currently this doesn't work). This patch also adds a lot of comments that are result of about two-week long investigation of how sinking pass works and why it does what it does.
* Drop proc-points that don't exist in the graph (#8205)Jan Stolarek2013-09-111-3/+3
| | | | | | | | On some architectures it might happen that stack layout pass will invalidate the list of calculated procpoints by dropping some of them. We fix this by checking whether a proc-point is in a graph at the beginning of proc-point analysis. This is a speculative fix for #8205.
* Fix a bug in stack layout with safe foreign calls (#8083)Simon Marlow2013-07-241-4/+2
| | | | | | | We weren't properly tracking the number of stack arguments in the continuation of a foreign call. It happened to work when the continuation was not a join point, but when it was a join point we were using the wrong amount of stack fixup.
* Temporarily disable common block elimination; fixes #8083 for nowIan Lynagh2013-07-231-3/+5
|
* Rewrite usingInconsistentPicReg as a table for clarityGabor Greif2013-04-061-5/+5
| | | | No change in functionality intended
* Fix typosGabor Greif2013-04-061-3/+3
|
* Rename all of the 'cmmz' flags and make them more consistent.Austin Seipp2012-12-191-19/+18
| | | | | | | | | | | | | | | | There's only a single compiler backend now, so the 'z' suffix means nothing. Also, the flags were confusingly named ('cmm-foo' vs 'foo-cmm',) and counter-intuitively, '-ddump-cmm' did not do at all what you expected since the new backend went live. Basically, all of the -ddump-cmmz-* flags are now -ddump-cmm-*. Some were renamed to be more consistent. This doesn't update the manual; it already mentions '-ddump-cmm' and that flag implies all the others anyway, which is probably what you want. Signed-off-by: Austin Seipp <mad.one@gmail.com>
* Tweak commentsIan Lynagh2012-12-021-2/+3
|
* Fix broken -fPIC on Darwin/PPC (#7442)PHO2012-11-241-4/+12
| | | | The workaround described in note [darwin-x86-pic] applies to Darwin/PPC too.
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-121-0/+12
| | | | | | | | | | | | | | | | | | This removes the OldCmm data type and the CmmCvt pass that converts new Cmm to OldCmm. The backends (NCGs, LLVM and C) have all been converted to consume new Cmm. The main difference between the two data types is that conditional branches in new Cmm have both true/false successors, whereas in OldCmm the false case was a fallthrough. To generate slightly better code we occasionally need to invert a conditional to ensure that the branch-not-taken becomes a fallthrough; this was previously done in CmmCvt, and it is now done in CmmContFlowOpt. We could go further and use the Hoopl Block representation for native code, which would mean that we could use Hoopl's postorderDfs and analyses for native code, but for now I've left it as is, using the old ListGraph representation for native code.
* Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-301-3/+3
| | | | | | | 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.
* Comment to explain why we need to split proc points on x86/Darwin with -fPICSimon Marlow2012-10-241-1/+31
|
* Fix -fPIC on OS X x86Ian Lynagh2012-10-231-0/+6
|
* Refactor the way dump flags are handledIan Lynagh2012-10-181-4/+4
| | | | | | | | | | | | | We were being inconsistent about how we tested whether dump flags were enabled; in particular, sometimes we also checked the verbosity, and sometimes we didn't. This lead to oddities such as "ghc -v4" printing an "Asm code" section which didn't contain any code, and "-v4" enabled some parts of "-ddump-deriv" but not others. Now all the tests use dopt, which also takes the verbosity into account as appropriate.
* Some alpha renamingIan Lynagh2012-10-161-4/+4
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Rename DynFlag to GeneralFlagIan Lynagh2012-10-161-2/+2
| | | | | This avoids confusion due to [DynFlag] and DynFlags being completely different types.
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* splitAtProcPoints: jump to the right place when tablesNextToCode == FalseSimon Marlow2012-09-201-1/+2
|
* make some debug output conditional on -ddump-cmmzSimon Marlow2012-09-181-1/+1
|
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-2/+2
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-1/+1
|
* Pass DynFlags down to bWordIan Lynagh2012-09-121-1/+1
| | | | | | I've switched to passing DynFlags rather than Platform, as (a) it's simpler to not have to extract targetPlatform in so many places, and (b) it may be useful to have DynFlags around in future.
* fix the name of an SCCSimon Marlow2012-08-311-1/+1
|
* debug printing of the CAFEnvSimon Marlow2012-08-311-0/+1
|
* Only run the second round of control-flow optimisations when -O is onSimon Marlow2012-08-091-2/+11
|
* Define callerSaves for all platformsIan Lynagh2012-08-071-1/+1
| | | | | | | | This means that we now generate the same code whatever platform we are on, which should help avoid changes on one platform breaking the build on another. It's also another step towards full cross-compilation.
* Make tablesNextToCode "dynamic"Ian Lynagh2012-08-061-2/+1
| | | | | This is a bit odd by itself, but it's a stepping stone on the way to putting "target unregisterised" into the settings file.
* Code reformattingSimon Marlow2012-08-021-28/+33
|
* add a sinking pass before stack layout (currently disabled)Simon Marlow2012-08-021-1/+8
|
* Don't shortcut call-returns when not splitting proc pointsSimon Marlow2012-08-021-3/+6
| | | | See Note [shortcut call returns]
* Explicitly share some return continuationsSimon Marlow2012-08-021-2/+6
| | | | | | | Instead of relying on common-block-elimination to share return continuations in the common case (case-alternative heap checks) we do it explicitly. This isn't hard to do, is more robust, and saves some compilation time. Full commentary in Note [sharing continuations].
* fix warningsSimon Marlow2012-07-301-1/+0
|
* New codegen: do not split proc-points when using the NCGSimon Marlow2012-07-301-30/+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.
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-1/+1
| | | | All the flags that 'ways' imply are now dynamic
* Refactor and simplify the SRT handlingSimon Marlow2012-07-171-69/+12
|
* Move sinking into a separate module, and add a simple inlining passSimon Marlow2012-07-171-2/+8
|
* Remove "fuel", adapt to Hoopl changes, fix warningsSimon Marlow2012-07-051-14/+16
|
* Fix merge-related problemsSimon Marlow2012-07-041-17/+7
|
* Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-07-041-11/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 unnecessary platform argumentsIan Lynagh2012-06-131-2/+2
| |
| * Remove PlatformOutputableIan Lynagh2012-06-131-14/+13
| | | | | | | | | | We can now get the Platform from the DynFlags inside an SDoc, so we no longer need to pass the Platform in.
| * Change -X flags into LANGUAGE pragmasIan Lynagh2012-02-261-2/+2
| |