summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmUtils.hs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Represent offsets into heap objects with byte, not word, offsetsSimon Marlow2014-03-111-4/+5
| | | | | I'd like to be able to pack together non-pointer fields that are less than a word in size, and this is a necessary prerequisite.
* Implement shortcuts for slow calls (#6084)Simon Marlow2013-11-281-0/+9
|
* Revert "Implement shortcuts for slow calls that would require PAPs (#6084)"Austin Seipp2013-10-261-9/+0
| | | | This reverts commit 2f5db98e90cf0cff1a11971c85f108a7480528ed.
* Implement shortcuts for slow calls that would require PAPs (#6084)Simon Marlow2013-10-251-0/+9
|
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-181-1/+1
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Remove unnecessary warnings suppressions, fixes ticket #7756; thanks ↵Edward Z. Yang2013-03-091-4/+0
| | | | | | monoidal for submitting. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Remove unused functions cmmConstrTag, cmmGetTagSimon Peyton Jones2013-03-091-7/+4
| | | | | Patch offered by Boris Sukholitko <boriss@gmail.com> Trac #7757
* Mimic OldCmm basic block ordering in the LLVM backend.Geoffrey Mainland2013-02-011-1/+30
| | | | | | | | | In OldCmm, the false case of a conditional was a fallthrough. In Cmm, conditionals have both true and false successors. When we convert Cmm to LLVM, we now first re-order Cmm blocks so that the false successor of a conditional occurs next in the list of basic blocks, i.e., it is a fallthrough, just like it (necessarily) did in OldCmm. Surprisingly, this can make a big performance difference.
* Always pass vector values on the stack.Geoffrey Mainland2013-02-011-10/+24
| | | | | Vector values are now always passed on the stack. This isn't particularly efficient, but it will have to do for now.
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-121-2/+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.
* Add a case for CmmLabelDiffOff to cmmOffsetLitSimon Marlow2012-10-241-0/+2
|
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove a little more CPPIan Lynagh2012-09-181-2/+2
|
* 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-2/+2
| | | | | It's now a newtyped Integer. Perhaps a newtyped Word32 would make more sense, though.
* Remove some uses of the WORDS_BIGENDIAN CPP symbolIan Lynagh2012-09-181-7/+5
|
* Give packHalfWordsCLit a more specific typeIan Lynagh2012-09-181-1/+1
| | | | | I'm not sure if there's a reason why the HeapRep constructor takes 2 WordOffs rather than 2 StgHalfWords.
* Move tAG_BITS into platformConstantsIan Lynagh2012-09-161-3/+2
|
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-16/+16
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-43/+42
|
* Pass DynFlags down to gcWordIan Lynagh2012-09-121-1/+1
|
* Pass DynFlags down to bWordIan Lynagh2012-09-121-44/+47
| | | | | | 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.
* Whitespace only in cmm/CmmUtils.hsIan Lynagh2012-09-111-77/+71
|
* Cleanup: add mkIntExpr and zeroExpr utilsSimon Marlow2012-08-311-8/+15
|
* Fix fencepost and byte/word bugs in cloneArray/copyArray (#7185)Simon Marlow2012-08-311-2/+3
|
* GHC 7.4 is now required for building HEADIan Lynagh2012-07-201-5/+0
|
* Remove "fuel", adapt to Hoopl changes, fix warningsSimon Marlow2012-07-051-18/+16
|
* Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-07-041-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Merge remote-tracking branch 'origin/unboxed-tuple-arguments2'Paolo Capriotti2012-06-051-3/+3
| |\
| | * 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
| * | Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+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.
* | take the analyses out of the FuelUniqSM monadSimon Marlow2012-03-151-10/+6
| |
* | kill some dead codeSimon Marlow2012-02-141-44/+1
| |
* | just commentsSimon Marlow2012-02-081-1/+2
| |
* | snapshot of latest improvementsSimon Marlow2012-01-231-1/+11
| |
* | add an SCCSimon Marlow2012-01-191-1/+1
| |
* | SnapshotSimon Marlow2012-01-171-20/+38
| |
* | More codegen refactoring with simonpjSimon Marlow2011-12-191-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.
* Fix validate with old bootstrapping compilersIan Lynagh2011-10-021-0/+5
| | | | | They weren't smart enough to see our GADT pattern matches are complete, so gave a warning.
* Replace a -w flag with the more specific -fno-warn-deprecationsIan Lynagh2011-10-021-1/+1
|
* rewrite branchChainElim; other refactoring in CmmContFlowOptSimon Marlow2011-08-251-1/+5
|
* Renaming onlySimon Peyton Jones2011-08-251-3/+3
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* More refactoring (CgRep)Simon Peyton Jones2011-08-251-0/+4
| | | | | | * 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-251-30/+362
|
* Merge in new code generator branch.Simon Marlow2011-01-241-84/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add new LLVM code generator to GHC. (Version 2)David Terei2010-06-151-1/+1
| | | | | | | | | | | | | | | | | | This was done as part of an honours thesis at UNSW, the paper describing the work and results can be found at: http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf A Homepage for the backend can be found at: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM Quick summary of performance is that for the 'nofib' benchmark suite, runtimes are within 5% slower than the NCG and generally better than the C code generator. For some code though, such as the DPH projects benchmark, the LLVM code generator outperforms the NCG and C code generator by about a 25% reduction in run times.
* Fix warnings in CmmUtilsIan Lynagh2008-12-291-11/+5
|
* Removed warnings, made Haddock happy, added examples in documentationdias@eecs.harvard.edu2008-10-171-1/+1
| | | | | The interesting examples talk about our story with heap checks in case alternatives and our story with the case scrutinee as a Boolean.