- 03 Sep, 2010 1 commit
-
-
Simon Marlow authored
-
- 31 Aug, 2010 1 commit
-
-
benl@ouroborus.net authored
-
- 30 Aug, 2010 2 commits
-
-
benl@ouroborus.net authored
-
benl@ouroborus.net authored
-
- 13 Jul, 2010 1 commit
-
-
dterei authored
-
- 15 Jun, 2010 1 commit
-
-
dterei authored
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.
-
- 05 May, 2010 1 commit
-
-
Simon Marlow authored
-
- 09 Apr, 2010 1 commit
-
-
Ian Lynagh authored
-
- 20 Mar, 2010 1 commit
-
-
Ian Lynagh authored
-
- 04 Jan, 2010 1 commit
-
-
simonpj@microsoft.com authored
The main purpose of this patch is to add a bunch of new rules to the coercion optimiser. They are documented in the (revised) Appendix of the System FC paper. Some code has moved about: - OptCoercion is now a separate module, mainly because it now uses tcMatchTy, which is defined in Unify, so OptCoercion must live higehr up in the hierarchy - Functions that manipulate Kinds has moved from Type.lhs to Coercion.lhs. Reason: the function typeKind now needs to call coercionKind. And in any case, a Kind is a flavour of Type, so it builds on top of Type; indeed Coercions and Kinds are both flavours of Type. This change required fiddling with a number of imports, hence the one-line changes to otherwise-unrelated modules - The representation of CoTyCons in TyCon has changed. Instead of an extensional representation (a kind checker) there is now an intensional representation (namely TyCon.CoTyConDesc). This was needed for one of the new coercion optimisations.
-
- 20 Nov, 2009 1 commit
-
-
simonpj@microsoft.com authored
-
- 19 Nov, 2009 1 commit
-
-
simonpj@microsoft.com authored
I finally got tired of the #ifdef OLD_STRICTNESS stuff. I had been keeping it around in the hope of doing old-to-new comparisions, but have failed to do so for many years, so I don't think it's going to happen. This patch deletes the clutter.
-
- 06 Nov, 2009 1 commit
-
-
Ben.Lippmeier@anu.edu.au authored
-
- 20 Sep, 2009 1 commit
-
-
Ian Lynagh authored
-
- 11 Sep, 2009 1 commit
-
-
Simon Marlow authored
Performance isn't an issue for reading the old-style package.conf files, so we might as well revert to using read and fix a bug at the same time.
-
- 10 Sep, 2009 1 commit
-
-
Simon Marlow authored
- the package DB is a directory containing one file per package instance (#723) - there is a binary cache of the database (#593, #2089) - the binary package is now a boot package - there is a new package, bin-package-db, containing the Binary instance of InstalledPackageInfo for the binary cache. Also included in this patch - Use colour in 'ghc-pkg list' to indicate broken or hidden packages Broken packages are red, hidden packages are Colour support comes from the terminfo package, and is only used when - not --simple-output - stdout is a TTY - the terminal type has colour capability - Fix the bug that 'ghc-pkg list --user' shows everything as broken
-
- 26 Aug, 2009 1 commit
-
-
Isaac Dupree authored
-
- 11 Aug, 2009 1 commit
-
-
Ian Lynagh authored
-
- 24 Jul, 2009 1 commit
-
-
Ian Lynagh authored
-
- 07 Jul, 2009 1 commit
-
-
Simon Marlow authored
-
- 18 May, 2009 1 commit
-
-
Ben.Lippmeier@anu.edu.au authored
* The old Reg type is now split into VirtualReg and RealReg. * For the graph coloring allocator, the type of the register graph is now (Graph VirtualReg RegClass RealReg), which shows that it colors in nodes representing virtual regs with colors representing real regs. (as was intended) * RealReg contains two contructors, RealRegSingle and RealRegPair, where RealRegPair is used to represent a SPARC double reg constructed from two single precision FP regs. * On SPARC we can now allocate double regs into an arbitrary register pair, instead of reserving some reg ranges to only hold float/double values.
-
- 29 Apr, 2009 1 commit
-
-
Ian Lynagh authored
-
- 26 Apr, 2009 1 commit
-
-
Ian Lynagh authored
-
- 20 Apr, 2009 1 commit
-
-
Ben.Lippmeier@anu.edu.au authored
-
- 23 Feb, 2009 1 commit
-
-
Ben.Lippmeier@anu.edu.au authored
-
- 16 Feb, 2009 2 commits
-
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
-
- 15 Feb, 2009 2 commits
-
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
- nativeGen/Instruction defines a type class for a generic instruction set. Each of the instruction sets we have, X86, PPC and SPARC are instances of it. - The register alloctors use this type class when they need info about a certain register or instruction, such as regUsage, mkSpillInstr, mkJumpInstr, patchRegs.. - nativeGen/Platform defines some data types enumerating the architectures and operating systems supported by the native code generator. - DynFlags now keeps track of the current build platform, and the PositionIndependentCode module uses this to decide what to do instead of relying of #ifdefs. - It's not totally retargetable yet. Some info info about the build target is still hardwired, but I've tried to contain most of it to a single module, TargetRegs. - Moved the SPILL and RELOAD instructions into LiveInstr. - Reg and RegClass now have their own modules, and are shared across all architectures.
-
- 05 Feb, 2009 1 commit
-
-
Ben.Lippmeier@anu.edu.au authored
- There are still some #ifdefs for choosing between i386, x86_64, linux, darwin and other OS's. - Also reformat SPARC.RegInfo to remove some of the visual noise.
-
- 13 Feb, 2009 1 commit
-
-
Ian Lynagh authored
This should fix the build with GHC 6.6
-
- 04 Feb, 2009 4 commits
-
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
-
- 03 Feb, 2009 3 commits
-
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
-
Ben.Lippmeier@anu.edu.au authored
-
- 13 Jan, 2009 1 commit
-
-
simonpj@microsoft.com authored
This patch does two main things a) Rewrite most of CorePrep to be much easier to understand (I hope!). The invariants established by CorePrep are now written out, and the code is more perspicuous. It is surpringly hard to get right, and the old code had become quite incomprehensible. b) Rewrite the eta-expander so that it does a bit of simplifying on-the-fly, and thereby guarantees to maintain the CorePrep invariants. This make it much easier to use from CorePrep, and is a generally good thing anyway. A couple of pieces of re-structuring: * I moved the eta-expander and arity analysis stuff into a new module coreSyn/CoreArity. Max will find that the type CoreArity.EtaInfo looks strangely familiar. * I moved a bunch of comments from Simplify to OccurAnal; that's why it looks as though there's a lot of lines changed in those modules. On the way I fixed various things - Function arguments are eta expanded f (map g) ===> let s = \x. map g x in f s - Trac #2368 The result is a modest performance gain, I think mainly due to the first of these changes: -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed -------------------------------------------------------------------------------- Min -1.0% -17.4% -19.1% -46.4% Max +0.3% +0.5% +5.4% +53.8% Geometric Mean -0.1% -0.3% -7.0% -10.2%
-
- 13 Oct, 2008 1 commit
-
-
dias@eecs.harvard.edu authored
o Fixed bug that emitted the copy-in code for closure entry in the wrong place -- at the initialization of the closure. o Refactored some of the closure entry code. o Added code to check that no LocalRegs are live-in to a procedure -- trip up some buggy programs earlier o Fixed environment bindings for thunks -- we weren't (re)binding the free variables in a thunk o Fixed a bug in proc-point splitting that dropped some updates to the entry block in a procedure. o Fixed improper calls to code that generates CmmLit's for strings o New invariant on cg_loc in CgIdInfo: the expression is always tagged o Code to load free vars on entry to a thunk was (wrongly) placed before the heap check. o Some of the StgCmm code was redundantly passing around Id's along with CgIdInfo's; no more. o Initialize the LocalReg's that point to a closure before allocating and initializing the closure itself -- otherwise, we have problems with recursive closure bindings o BlockEnv and BlockSet types are now abstract. o Update frames: - push arguments in Old call area - keep track of the return sp in the FCode monad - keep the return sp in every call, tail call, and return (because it might be different at different call sites, e.g. tail calls to the gc after a heap check are performed before pushing the update frame) - set the sp appropriately on returns and tail calls o Reduce call, tail call, and return to a single LastCall node o Added slow entry code, using different calling conventions on entry and tail call o More fixes to the calling convention code. The tricky stuff is all about the closure environment: it must be passed in R1, but in non-closures, there is no such argument, so we can't treat all arguments the same way: the closure environment is special. Maybe the right step forward would be to define a different calling convention for closure arguments. o Let-no-escapes need to be emitted out-of-line -- otherwise, we drop code. o Respect RTS requirement of word alignment for pointers My stack allocation can pack sub-word values into a single word on the stack, but it wasn't requiring word-alignment for pointers. It does now, by word-aligning both pointer registers and call areas. o CmmLint was over-aggresively ruling out non-word-aligned memory references, which may be kosher now that we can spill small values into a single word. o Wrong label order on a conditional branch when compiling switches. o void args weren't dropped in many cases. To help prevent this kind of mistake, I defined a NonVoid wrapper, which I'm applying only to Id's for now, although there are probably other good candidates. o A little code refactoring: separate modules for procpoint analysis splitting, stack layout, and building infotables. o Stack limit check: insert along with the heap limit check, using a symbolic constant (a special CmmLit), then replace it when the stack layout is known. o Removed last node: MidAddToContext o Adding block id as a literal: means that the lowering of the calling conventions no longer has to produce labels early, which was inhibiting common-block elimination. Will also make it easier for the non-procpoint-splitting path. o Info tables: don't try to describe the update frame! o Over aggressive use of NonVoid!!!! Don't drop the non-void args before setting the type of the closure!!! o Sanity checking: Added a pass to stub dead dead slots on the stack (only ~10 lines with the dataflow framework) o More sanity checking: Check that incoming pointer arguments are non-stubbed. Note: these checks are still subject to dead-code removal, but they should still be quite helpful. o Better sanity checking: why stop at function arguments? Instead, in mkAssign, check that _any_ assignment to a pointer type is non-null -- the sooner the crash, the easier it is to debug. Still need to add the debugging flag to turn these checks on explicitly. o Fixed yet another calling convention bug. This time, the calls to the GC were wrong. I've added a new convention for GC calls and invoked it where appropriate. We should really straighten out the calling convention stuff: some of the code (and documentation) is spread across the compiler, and there's some magical use of the node register that should really be handled (not avoided) by calling conventions. o Switch bug: the arms in mkCmmLitSwitch weren't returning to a single join point. o Environment shadowing problem in Stg->Cmm: When a closure f is bound at the top-level, we should not bind f to the node register on entry to the closure. Why? Because if the body of f contains a let-bound closure g that refers to f, we want to make sure that it refers to the static closure for f. Normally, this would all be fine, because when we compile a closure, we rebind free variables in the environment. But f doesn't look like a free variable because it's a static value. So, the binding for f remains in the environment when we compile g, inconveniently referring to the wrong thing. Now, I bind the variable in the local environment only if the closure is not bound at the top level. It's still okay to make assumptions about the node holding the closure environment; we just won't find the binding in the environment, so code that names the closure will now directly get the label of the static closure, not the node register holding a pointer to the static closure. o Don't generate bogus Cmm code containing SRTs during the STG -> Cmm pass! The tables made reference to some labels that don't exist when we compute and generate the tables in the back end. o Safe foreign calls need some special treatment (at least until we have the integrated codegen). In particular: o they need info tables o they are not procpoints -- the successor had better be in the same procedure o we cannot (yet) implement the calling conventions early, which means we have to carry the calling-conv info all the way to the end o We weren't following the old convention when registering a module. Now, we use update frames to push any new modules that have to be registered and enter the youngest one on the stack. We also use the update frame machinery to specify that the return should pop the return address off the stack. o At each safe foreign call, an infotable must be at the bottom of the stack, and the TSO->sp must point to it. o More problems with void args in a direct call to a function: We were checking the args (minus voids) to check whether the call was saturated, which caused problems when the function really wasn't saturated because it took an extra void argument. o Forgot to distinguish integer != from floating != during Stg->Cmm o Updating slotEnv and areaMap to include safe foreign calls The dataflow analyses that produce the slotEnv and areaMap give results for each basic block, but we also need the results for a safe foreign call, which is a middle node. After running the dataflow analysis, we have another pass that updates the results to includ any safe foreign calls. o Added a static flag for the debugging technique that inserts instructions to stub dead slots on the stack and crashes when a stubbed value is loaded into a pointer-typed LocalReg. o C back end expects to see return continuations before their call sites. Sorted the flowgraphs appropriately after splitting. o PrimOp calling conventions are special -- unlimited registers, no stack Yet another calling convention... o More void value problems: if the RHS of a case arm is a void-typed variable, don't try to return it. o When calling some primOp, they may allocate memory; if so, we need to do a heap check when we return from the call.
-