1. 16 Feb, 2007 1 commit
  2. 14 Feb, 2007 1 commit
  3. 15 Feb, 2007 1 commit
    • mnislaih's avatar
      Fixed a bug in the datacon names extension in the dynamic linker · 47ec5807
      mnislaih authored
      My code was doing unnecessary work when trying to get hold of all the BCOs in order to sniff the datacon names.
      This involved calculating the transitive closure of a relation and was causing a huge performance slowdown in GHCi, as benchmarks uncovered. It turns out that this calculation was unnecessary.
      47ec5807
  4. 13 Feb, 2007 1 commit
  5. 15 Feb, 2007 1 commit
    • Simon Marlow's avatar
      When the pipeline just copies the file, prepend a LINE pragma · cf411c9a
      Simon Marlow authored
      For example, "ghc -E Foo.hs -o Foo.bar" just copies Foo.hs to
      Foo.bar.  This patch adds a LINE pragma to the beginning of Foo.bar so
      that further processing can track the location of the original file.
      
      The motiviation for this is bug #1044.  When generating Haddock docs,
      we preprocess the .hs to a .raw-hs, sometimes this doesn't involve any
      actual preprocessing and in those cases we lose track of the original
      filename.
      cf411c9a
  6. 09 Feb, 2007 3 commits
    • simonpj@microsoft.com's avatar
      Major improvement to SpecConstr · cac2aca1
      simonpj@microsoft.com authored
      This patch improves the SpecConstr pass, by 
        a) making it work with join points
        b) making it generate specialisations transitively
      
      As part of it, SpecConstr now carries a substitution with it, which
      runs over the whole program as it goes.  This turned out to be 
      a big win; simplified the implementation quite a bit.
      
      I have *disabled* the specialisation on lambdas; it's pretty fragile,
      and sometimes generates more and more specialisations. Something to
      come back to, perhaps.
      
      I rejigged the flag-handling a bit.  Now the specification of passes
      in DynFlags is a bit nicer; see
      	- optLevelFlags top-level data structure
      	- runWhen function
      	- CoreDoPasses constructor
      
      There are now command-line flags
      	-fspec-constr
      	-fliberate-case
      	-fspec-threshold=N
      which do the obvious thing.  -O2 switches on both spec-constr and liberate-case.
      You can use -fno-liberate-case, -fno-spec-constr after -O2 to switch them off again.
      
      The spec-threshold applies to both these transformations; default value 200 for now.
      
      
      
      
      cac2aca1
    • simonpj@microsoft.com's avatar
      Refactor the simplifier's treatment of case expressions · e9f23b4c
      simonpj@microsoft.com authored
      (NB: this patch could conceivably require some bits of the 
      following SpecConstr patch to compile cleanly.  It's conceptually
      independent, but I'm not 100% certain that I've included all
      the necessary bits here.)
      
      This patch cleans up the simplifier's handling of various
      otimisations for case expressions, notably
        - case elimination (discarding the case altogether)
        - merging identical alternatives
        - discarding impossible alternative
        - merging nested cases
      
      Previously this was partly handled before, and partly after,
      simplifying the case alternatives. The trouble with that is
      that the dead-ness information on the case binders gets munged
      during simplification, and that turned out to mean that 
      case elmination essentially never happened -- stupid.
      
      Now I've moved it all to before simplifying the alterntives.
      In fact this reduces the amount of code, I think, and it's
      certainly tidier.  I don't think there is any loss.
      
      e9f23b4c
    • Simon Marlow's avatar
      Ticky is an RTS-only way; also fix collateral damage to other ways · 5bf1b7f5
      Simon Marlow authored
      The ticky static flag was being poked too early, which lead to
      breakage in the -prof way amongst other things.  I've installed some
      sanity checking to make sure we catch this earlier if it happens again.
      5bf1b7f5
  7. 07 Feb, 2007 7 commits
    • mnislaih's avatar
      Type reconstruction/RTTI: improve handling of newtypes · eeaa0399
      mnislaih authored
        Newtypes have always been a problem because they are not there at runtime, but we need to take them into account.
        
        Tests ghci.debugger/print011 and ghci.debugger/print012 cover this
      eeaa0399
    • mnislaih's avatar
      Optimize dynamic breakpoints for speed · 9004e883
      mnislaih authored
      Made a bit faster the test which gets done every time a running program hits a dynamic breakpoint. I moved the bounds checking inside a DEBUG pragma and replaced (IArray.!) for unsafeAt
      9004e883
    • simonpj@microsoft.com's avatar
      544d0172
    • simonpj@microsoft.com's avatar
      f47590d7
    • simonpj@microsoft.com's avatar
      Spelling fix · 119ede05
      simonpj@microsoft.com authored
      119ede05
    • simonpj@microsoft.com's avatar
      Fix bug in -ddump-minimal imports Trac #1025 · 057b0446
      simonpj@microsoft.com authored
      The code for -ddump-minimal-imports was erroneously using loadSrcInterface,
      which looks only for *exposed* modules.  It should instead use loadSysInterface
      which looks for all interfaces.
      
      The fix is straightforward.  MERGE to 6.6 branch.
      057b0446
    • chevalier@alum.wellesley.edu's avatar
      Lightweight ticky-ticky profiling · 5ddee764
      chevalier@alum.wellesley.edu authored
      The following changes restore ticky-ticky profiling to functionality
      from its formerly bit-rotted state. Sort of. (It got bit-rotted as part
      of the switch to the C-- back-end.)
      
      The way that ticky-ticky is supposed to work is documented in Section 5.7
      of the GHC manual (though the manual doesn't mention that it hasn't worked
      since sometime around 6.0, alas). Changes from this are as follows (which
      I'll document on the wiki):
      
      * In the past, you had to build all of the libraries with way=t in order to
      use ticky-ticky, because it entailed a different closure layout. No longer.
      You still need to do make way=t in rts/ in order to build the ticky RTS,
      but you should now be able to mix ticky and non-ticky modules.
      
      * Some of the counters that worked in the past aren't implemented yet.
      I was originally just trying to get entry counts to work, so those should
      be correct. The list of counters was never documented in the first place,
      so I hope it's not too much of a disaster that some don't appear anymore.
      Someday, someone (perhaps me) should document all the counters and what 
      they do. For now, all of the counters are either accurate (or at least as
      accurate as they always were), zero, or missing from the ticky profiling
      report altogether.
      
      This hasn't been particularly well-tested, but these changes shouldn't
      affect anything except when compiling with -fticky-ticky (famous last
      words...)
      
      Implementation details:
      
      I got rid of StgTicky.h, which in the past had the macros and declarations 
      for all of the ticky counters. Now, those macros are defined in Cmm.h.
      StgTicky.h was still there for inclusion in C code. Now, any remaining C
      code simply cannot call the ticky macros -- or rather, they do call those
      macros, but from the perspective of C code, they're defined as no-ops. 
      (This shouldn't be too big a problem.)
      
      I added a new file TickyCounter.h that has all the declarations for ticky
      counters, as well as dummy macros for use in C code. Someday, these 
      declarations should really be automatically generated, since they need
      to be kept consistent with the macros defined in Cmm.h.
      
      Other changes include getting rid of the header that was getting added to
      closures before, and getting rid of various code having to do with eager
      blackholing and permanent indirections (the changes under compiler/ 
      and rts/Updates.*).
      5ddee764
  8. 06 Feb, 2007 7 commits
  9. 05 Feb, 2007 7 commits
    • Ian Lynagh's avatar
      Fix syntax error · 001d6ffd
      Ian Lynagh authored
      001d6ffd
    • simonpj@microsoft.com's avatar
      b024f2af
    • simonpj@microsoft.com's avatar
      Improve handling of partial applications involving casts · b2cc243a
      simonpj@microsoft.com authored
      This patch improves prepareRhs, so that it deals better with casts.
      
      We want to deal well cases like this
      	v = (f e1 `cast` co) e2
      Here we want to make e1,e2 trivial and get
      	x1 = e1; x2 = e2; v = (f x1 `cast` co) v2
      
      This really happens in parser libraries, which wrap functions in newtypes.
      b2cc243a
    • simonpj@microsoft.com's avatar
      Float casts out of lambdas · 4539cb1b
      simonpj@microsoft.com authored
      See Note [Casts and lambdas] in SimplUtils.  I found this transformation
      when staring at some cast-heavy code generated by
      Language.Haskell.Lexer.hs in the haskell-src library.
      
      The basic transformation is this:
      	(\x. e `cast` g1)  -->  (\x.e) `cast` (tx -> g1)
      where x:tx.
      4539cb1b
    • simonpj@microsoft.com's avatar
    • simonpj@microsoft.com's avatar
      Establish the CoreSyn let/app invariant · 7b01315d
      simonpj@microsoft.com authored
      This patch clears up a long-standing wart.   For some time it's been the
      case that 
      	the RHS of a non-recursive let can be unlifed iff 
      	the RHS is ok-for-speculation
      
      This patch extends the invariant to the argument of an App, and 
      establishes it by the smart constructors mkDsApp, mkDsApps in the desugarer.
      
      Once established, it should be maintained by the optimiser.
      
      This tides up some awkward cases, notably in exprIsHNF, and I think it
      fixes a outright strictness bug in Simplify.prepareRhs.
      7b01315d
    • simonpj@microsoft.com's avatar
      Improve simplification of coercions · 77241a03
      simonpj@microsoft.com authored
      At the moment GHC really does very little simplification of coercions.
      This patch improves matters, but it's still not great, especially when
      you have chains linked together with 'trans'. 
      
      I'm also concerned that I have not yet implemented the 'leftc' and 'rightc'
      coercions we added to the paper. 
      
      But at least things are better than they were.  In particular
      	g `trans` sym g
      now cancels to give the identity.
      
      77241a03
  10. 22 Jan, 2007 3 commits
  11. 19 Jan, 2007 4 commits
  12. 04 Feb, 2007 3 commits
  13. 02 Feb, 2007 1 commit