summaryrefslogtreecommitdiff
path: root/compiler/cmm
Commit message (Collapse)AuthorAgeFilesLines
...
| * Refactor CmmLive and CmmSpillReload.Edward Z. Yang2011-06-173-94/+49
| | | | | | | | | | | | | | | | | | | | * Move dead assignment elimination to CmmLive * Kill off dead code in CmmSpillReload related to non-splitting procpoints case * Refactor dual liveness transfer function to more closely mimic CmmLive's liveness transfer. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Fix buildIan Lynagh2011-06-172-14/+2
| | | | | | | | | | I'm not sure what's going on with these warnings, but for now I've suppressed them all.
* | Fix the build with GHC 6.12Ian Lynagh2011-06-172-4/+14
|/
* Refactoring CmmSpillReload and CmmLive.Edward Z. Yang2011-06-174-37/+49
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Add type signature to invalidateVolatile.Edward Z. Yang2011-06-151-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix build for GHC earlier than 7.0.1.Edward Z. Yang2011-06-152-2/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement regslot inlining, document soundness concerns.Edward Z. Yang2011-06-143-25/+141
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Split out assignment rewriting to own module.Edward Z. Yang2011-06-143-464/+495
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Rename CmmCPS to CmmPipeline.Edward Z. Yang2011-06-142-15/+13
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Move control flow optimization to CmmCPS.Edward Z. Yang2011-06-142-10/+17
| | | | | | | | | | Unfortunately, I couldn't remove all incidences of runCmmContFlowOpt from HscMain; in particular, there is a Cmm conversion testing facility which may run with only control flow optimizations, which I preserved the semantics of. Given the state of the current codegen, this code might be moribund anyway. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Remove type synonyms for CmmFormals, CmmActuals (and hinted versions).Edward Z. Yang2011-06-139-40/+34
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Bake in ByteOff to ParamLocation, and remove ArgumentFormat synonym.Edward Z. Yang2011-06-133-11/+7
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Remove unused assignArguments and argumentsSize.Edward Z. Yang2011-06-132-17/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Extra comment about WithRegUsage.Edward Z. Yang2011-06-131-0/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2011-06-102-11/+11
|\
| * Refactor SrcLoc and SrcSpanIan Lynagh2011-06-092-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Unhelpful" cases are now in a separate type. This allows us to improve various things, e.g.: * Most of the panic's in SrcLoc are now gone * The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it knows that it has real locations and thus can assume that the line number etc really exists * Some of the more suspicious cases are no longer necessary, e.g. we no longer need this case in advanceSrcLoc: advanceSrcLoc loc _ = loc -- Better than nothing More improvements can probably be made, e.g. tick locations can probably use RealSrcSpans too.
* | Comments, layout and cmm-notesSimon Peyton Jones2011-06-103-19/+68
|/ | | | ...all to do with the new codgen path
* Fold constants during forward substitution in the Cmm mini-inlinerJohan Tibell2011-06-011-8/+17
| | | | This exposes new constants that can be propagated.
* Implement forward substitution of constants in the Cmm mini-inlinerJohan Tibell2011-06-011-4/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the mini-inliner would only forward substitute assignments to registers that were used exactly once, to not risk duplicating computation. For constants there's no such risk so we always substitute. Prior to the change the Cmm fn { bits64 a, b; a = 1; b = a + a; RET_N(b); } would be optimized as fn() { [] } ca: _cb::I64 = 1; R1 = _cb::I64 + _cb::I64; jump (I64[Sp + 0]) (); } but after it would be optimized as fn() { [] } ca: R1 = 2; jump (I64[Sp + 0]) (); } Note that this pass does not deal with the now dead assignment.
* Add new mem{cpy,set,move} cmm prim ops.David Terei2011-05-312-1/+12
|
* Make array copy primops inlineJohan Tibell2011-05-191-2/+3
|
* Work around lack of saving volatile registers from unsafe foreign calls.Edward Z. Yang2011-05-153-17/+54
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* More aggressive clobber detection with Hp and RegSlot.Edward Z. Yang2011-05-151-3/+19
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Split -ddump-cmmz into many smaller flags.Edward Z. Yang2011-05-151-45/+43
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* More aggressive CmmRegOff inlining, and fix failure to inline to assignments.Edward Z. Yang2011-05-153-16/+33
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Generalized assignment rewriting pass.Edward Z. Yang2011-05-152-103/+417
| | | | | | | This assignment rewriting pass subsumes the previous reload sinking pass, and also performs basic inlining. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Merge remote branch 'origin/master'Simon Peyton Jones2011-05-113-13/+44
|\
| * fix the names of the floating-point operations in the Cmm parserSimon Marlow2011-05-111-10/+15
| |
| * Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2011-05-091-15/+0
| |\
| * | Comments onlySimon Peyton Jones2011-05-092-3/+29
| | |
* | | Merge ghc-new-co into master branchSimon Peyton Jones2011-05-091-0/+1
|\ \ \ | |_|/ |/| |
| * | Merge master into the ghc-new-co branchSimon Peyton Jones2011-05-063-20/+71
| |\ \ | | |/
| * | Merge remote branch 'origin/master' into ghc-new-coSimon Peyton Jones2011-04-3012-87/+204
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: compiler/typecheck/TcErrors.lhs compiler/typecheck/TcSMonad.lhs compiler/typecheck/TcType.lhs compiler/types/TypeRep.lhs
| * | | This BIG PATCH contains most of the work for the New Coercion RepresentationSimon Peyton Jones2011-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See the paper "Practical aspects of evidence based compilation in System FC" * Coercion becomes a data type, distinct from Type * Coercions become value-level things, rather than type-level things, (although the value is zero bits wide, like the State token) A consequence is that a coerion abstraction increases the arity by 1 (just like a dictionary abstraction) * There is a new constructor in CoreExpr, namely Coercion, to inject coercions into terms
* | | | Remove some dead codeIan Lynagh2011-05-071-15/+0
| |_|/ |/| | | | | | | | Not needed now that we don't support registerised via-C compilation.
* | | Improve dead block calculation, per Simon Marlow's advice.Edward Z. Yang2011-05-051-21/+20
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | | Remove the OMIT_NATIVE_CODEGEN ifdefIan Lynagh2011-05-011-10/+9
| | | | | | | | | | | | | | | | | | We now test cGhcWithNativeCodeGen == "YES" instead.
* | | Implement dead basic block elimination.Edward Z. Yang2011-04-301-0/+61
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | | Don't expose the cas definition to .hc filesIan Lynagh2011-04-302-10/+2
| |/ |/| | | | | | | This is more pleasant than having the C generator check whether the function it's calling is cas, and not generate a prototype if so.
* | Eliminate GC check when no extra stack is used.Edward Z. Yang2011-04-272-4/+14
| | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Give manifestSP better information about the actual SP location.Edward Z. Yang2011-04-273-31/+121
| | | | | | | | | | | | | | This patch fixes silliness where the SP pointer is continually bumped up and down. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | cmm-notes updates.Edward Z. Yang2011-04-261-13/+16
| | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Raw versions of if and switch.Edward Z. Yang2011-04-261-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes the following statements valid C--, which uses the block ID directly rather than generating an anonymous block: if (expr) goto foo; switch expr { case 0: goto foo; case 1: goto bar; } Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Don't generate a prototype for casIan Lynagh2011-04-202-3/+11
| | | | | | | | | | I'm not sure if this is the best way to fix this, but it fixes the unreg build.
* | Revert "Generalized assignment rewriting pass."Edward Z. Yang2011-04-152-398/+103
| | | | | | | | This reverts commit 2ec796239b782505cfb305af2789abcfa820baaf.
* | Generalized assignment rewriting pass.Edward Z. Yang2011-04-152-103/+398
| | | | | | | | | | | | | | This assignment rewriting pass subsumes the previous reload sinking pass, and also performs basic inlining. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Disable check word address lint check, due to inlined pointer tags.Edward Z. Yang2011-04-151-7/+8
| | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Add GenCmmGraph, which is a generic version of CmmGraph.Edward Z. Yang2011-04-152-9/+14
| | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Always support optimization fuel.Edward Z. Yang2011-04-131-14/+0
| | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Update CmmRegOff shorthand for CmmMachOp.Edward Z. Yang2011-04-131-2/+4
|/ | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>