summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-10-3116-70/+69
|\
| * Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-3016-67/+67
| | | | | | | | | | | | | | 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.
| * Cmm jumps always have live register information.Geoffrey Mainland2012-10-301-3/+2
| | | | | | | | Jumps now always have live register information attached, so drop Maybes.
* | Do not treat a constructor in a *pattern* as a *use* of that constructorSimon Peyton Jones2012-10-291-6/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | Occurrences in terms are uses, in patterns they are not. In this way we get unused-constructor warnings from modules like this module M( f, g, T ) where data T = T1 | T2 Bool f x = T2 x g T1 = True g (T2 x) = x Here a T1 value cannot be constructed, so we can warn. The use in a pattern doesn't count. See Note [Patterns are not uses] in RnPat. Interestingly this change exposed three module in GHC itself that had unused constructors, which I duly removed: * ghc/Main.hs * compiler/ghci/ByteCodeAsm * compiler/nativeGen/PPC/RegInfo Their changes are in this patch.
* Whitespace only in nativeGen/PIC.hsIan Lynagh2012-10-191-282/+275
|
* Refactor the way dump flags are handledIan Lynagh2012-10-182-7/+7
| | | | | | | | | | | | | 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-166-39/+39
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-082-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 some old-codegen cruftSimon Marlow2012-09-251-12/+3
|
* fix panic message typoSimon Marlow2012-09-251-1/+1
|
* whitespace and panic message fixupSimon Marlow2012-09-241-8/+8
|
* whitespace onlySimon Marlow2012-09-241-29/+21
|
* Generate better code for "if (3 <= x) then ..."Simon Marlow2012-09-242-2/+31
|
* Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-09-209-85/+194
|\
| * fix warningsSimon Marlow2012-09-201-4/+1
| |
| * fix warningSimon Marlow2012-09-201-0/+5
| |
| * Teach the linear register allocator how to allocate more stack if necessarySimon Marlow2012-09-208-82/+189
| | | | | | | | | | | | | | | | | | This squashes the "out of spill slots" panic that occasionally happens on x86, by adding instructions to bump and retreat the C stack pointer as necessary. The panic has become more common since the new codegen, because we lump code into larger blocks, and the register allocator isn't very good at reusing stack slots for spilling (see Note [extra spill slots]).
* | Remove redundant pragmas from RegAlloc.LivenessIan Lynagh2012-09-201-2/+0
| |
* | Make addSRM to strict additionsIan Lynagh2012-09-201-1/+4
| | | | | | | | I assume that this is what is intended, as it is used with foldl'
* | Fix warnings in RegAlloc.Graph.StatsIan Lynagh2012-09-201-1/+6
| |
* | Whitespace only in nativeGen/RegAlloc/Graph/Stats.hsIan Lynagh2012-09-201-198/+192
|/
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-165-32/+32
|
* Move some more constants into platformConstantsIan Lynagh2012-09-1414-81/+93
|
* Remove more Platform argumentsIan Lynagh2012-09-142-50/+51
|
* Whitespace only in nativeGen/RegAlloc/Linear/JoinToTargets.hsIan Lynagh2012-09-141-205/+196
|
* Remove more Platform argumentsIan Lynagh2012-09-143-30/+33
|
* Remove a load of Platform arguments from RegM functionsIan Lynagh2012-09-141-74/+73
|
* Put DynFlags into the RegM monadIan Lynagh2012-09-143-20/+26
| | | | | Also moved the type definition into RegAlloc.Linear.State to de-orphan the Monad instance.
* Whitespace only in nativeGen/RegAlloc/Linear/State.hsIan Lynagh2012-09-141-55/+50
|
* Move more constants into platformConstantsIan Lynagh2012-09-142-7/+9
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-125-31/+32
|
* Pass DynFlags down to bWordIan Lynagh2012-09-1212-110/+135
| | | | | | 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.
* Remove some CPPIan Lynagh2012-09-104-26/+81
|
* Handle II16 size value in PowerPC code generator.Erik de Castro Lopo2012-09-081-2/+2
|
* Fix the PPC and SPARC NCGs to handle multiple info tables in a procSimon Marlow2012-09-072-32/+42
|
* Make the ways dynamicIan Lynagh2012-09-031-8/+7
|
* Load the PIC base register on every entry pointSimon Marlow2012-08-311-7/+27
| | | | (fixes dyn tests with -fnew-codegen on x86)
* Remove some CPP from nativeGen/X86/Instr.hsIan Lynagh2012-08-281-5/+4
|
* Remove some CPP from nativeGen/PPC/Regs.hIan Lynagh2012-08-283-27/+16
|
* Remove some old commented-out codeIan Lynagh2012-08-281-128/+0
|
* Move more code into codeGen/CodeGen/Platform.hsIan Lynagh2012-08-2818-974/+202
| | | | | | | | HaskellMachRegs.h is no longer included in anything under compiler/ Also, includes/CodeGen.Platform.hs now includes "stg/MachRegs.h" rather than <stg/MachRegs.h> which means that we always get the file from the tree, rather than from the bootstrapping compiler.
* Fix -fPIC with the new code generatorSimon Marlow2012-08-284-7/+7
| | | | The CmmBlocks inside CmmExprs were not getting the PIC treatment
* Fix for optimizer bug on linux-powerpc (#6156).Erik de Castro Lopo2012-08-231-4/+4
|
* More CPP removal in nativeGen/X86/Regs.hsIan Lynagh2012-08-222-12/+10
|
* More CPP removal in nativeGen/X86/Regs.hsIan Lynagh2012-08-221-15/+10
|
* Remove some CPP in nativeGen/X86/Regs.hsIan Lynagh2012-08-222-30/+24
|
* Make the PPC globalRegMaybe more similar to the other platforms'Ian Lynagh2012-08-212-27/+27
|
* Whitespace only in compiler/nativeGen/PPC/Regs.hsIan Lynagh2012-08-211-201/+194
|
* Whitespace only in nativeGen/RegAlloc/Linear/X86/FreeRegs.hsIan Lynagh2012-08-211-24/+17
|
* Remove unused 'targetWordSize'Ian Lynagh2012-08-211-6/+0
|