1. 14 Jun, 2012 1 commit
  2. 13 Jun, 2012 7 commits
    • Ian Lynagh's avatar
      Remove more redundant Platform arguments · ac6edfae
      Ian Lynagh authored
      ac6edfae
    • Simon Peyton Jones's avatar
      Simplify the implementation of Implicit Parameters · 5a8ac0f8
      Simon Peyton Jones authored
      This patch re-implements implicit parameters via a class
      with a functional dependency:
      
          class IP (n::Symbol) a | n -> a where
            ip :: a
      
      This definition is in the library module GHC.IP. Notice
      how it use a type-literal, so we can have constraints like
         IP "x" Int
      Now all the functional dependency machinery works right to make
      implicit parameters behave as they should.
      
      Much special-case processing for implicit parameters can be removed
      entirely. One particularly nice thing is not having a dedicated
      "original-name cache" for implicit parameters (the nsNames field of
      NameCache).  But many other cases disappear:
      
        * BasicTypes.IPName
        * IPTyCon constructor in Tycon.TyCon
        * CIPCan constructor  in TcRnTypes.Ct
        * IPPred constructor  in Types.PredTree
      
      Implicit parameters remain special in a few ways:
      
       * Special syntax.  Eg the constraint (IP "x" Int) is parsed
         and printed as (?x::Int).  And we still have local bindings
         for implicit parameters, and occurrences thereof.
      
       * A implicit-parameter binding  (let ?x = True in e) amounts
         to a local instance declaration, which we have not had before.
         It just generates an implication contraint (easy), but when
         going under it we must purge any existing bindings for
         ?x in the inert set.  See Note [Shadowing of Implicit Parameters]
         in TcSimplify
      
       * TcMType.sizePred classifies implicit parameter constraints as size-0,
         as before the change
      
      There are accompanying patches to libraries 'base' and 'haddock'
      
      All the work was done by Iavor Diatchki
      5a8ac0f8
    • Ian Lynagh's avatar
      Remove some more Platform arguments · 5633b561
      Ian Lynagh authored
      5633b561
    • Ian Lynagh's avatar
      Follow spelling fixes · 0cba443f
      Ian Lynagh authored
      0cba443f
    • Ian Lynagh's avatar
      Remove lots of commented out 'in' keywords · bfe94012
      Ian Lynagh authored
      bfe94012
    • Ian Lynagh's avatar
      Tweak the way UsageErrors are constructed · d2bb4777
      Ian Lynagh authored
      Using 'unlines' meant that we get a trailing newline, which gave
      different output.
      d2bb4777
    • Ian Lynagh's avatar
      Remove PlatformOutputable · d06edb8e
      Ian Lynagh authored
      We can now get the Platform from the DynFlags inside an SDoc, so we
      no longer need to pass the Platform in.
      d06edb8e
  3. 12 Jun, 2012 9 commits
  4. 11 Jun, 2012 8 commits
  5. 08 Jun, 2012 2 commits
  6. 07 Jun, 2012 2 commits
  7. 06 Jun, 2012 1 commit
  8. 05 Jun, 2012 1 commit
  9. 04 Jun, 2012 1 commit
  10. 29 May, 2012 5 commits
  11. 28 May, 2012 2 commits
    • Ian Lynagh's avatar
      Add defaultLogActionHPrintDoc to DynFlags · a7b1d219
      Ian Lynagh authored
      We now use this function rather than Outputable.{printSDoc,printErrs}.
      
      Outputable is arguably a better home for the function, but putting it
      in DynFlags should dissuade people from using it inappropriately (in
      particular, nothing other than the default hooks should have stdout
      or stderr hardcoded).
      
      Not exporting it at all would also be an option, but exporting it with
      an ungainly name will make it slightly easier for people who want to
      send output to other Handles for some reason.
      a7b1d219
    • Simon Peyton Jones's avatar
      Be less aggressive about the result discount · 4fa3f16d
      Simon Peyton Jones authored
      This patch fixes Trac #6099 by reducing the result discount in CoreUnfold.conSize.
      See Note [Constructor size and result discount] in CoreUnfold.
      
      The existing version is definitely too aggressive. Simon M found it an
      "unambiguous win" but it is definitely what led to the bloat. In a function
      with a lot of case branches, all returning a constructor, the discount could
      grow arbitrarily large.
      
      I also had to increase the -funfolding-creation-threshold from 450 to 750,
      otherwise some functions that should inline simply never get an unfolding.
      (The massive result discount was allow the unfolding to appear before.)
      
      The nofib results are these, picking a handful of outliers to show.
      
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
      --------------------------------------------------------------------------------
               fulsom          -0.5%     -1.6%     -2.8%     -2.6%    +31.1%
             maillist          -0.2%     -0.0%      0.09      0.09     -3.7%
               mandel          -0.4%     +6.6%      0.12      0.12     +0.0%
             nucleic2          -0.2%    +18.5%      0.11      0.11     +0.0%
              parstof          -0.4%     +4.0%      0.00      0.00     +0.0%
      --------------------------------------------------------------------------------
                  Min          -0.9%     -1.6%    -19.7%    -19.7%     -3.7%
                  Max          +0.3%    +18.5%     +2.7%     +2.7%    +31.1%
       Geometric Mean          -0.3%     +0.4%     -3.0%     -3.0%     +0.2%
      
      Turns out that nucleic2 has a function
        Main.$wabsolute_pos =
          \ (ww_s4oj :: Types.Tfo) (ww1_s4oo :: Types.FloatT)
            (ww2_s4op :: Types.FloatT) (ww3_s4oq :: Types.FloatT) ->
            case ww_s4oj
            of _
            { Types.Tfo a_a1sS b_a1sT c_a1sU d_a1sV e_a1sW f_a1sX g_a1sY h_a1sZ i_a1t0 tx_a1t1 ty_a1t2 tz_a1t3 ->
            (# case ww1_s4oo of _ { GHC.Types.F# x_a2sO ->
               case a_a1sS of _ { GHC.Types.F# y_a2sS ->
               case ww2_s4op of _ { GHC.Types.F# x1_X2y9 ->
               case d_a1sV of _ { GHC.Types.F# y1_X2yh ->
               case ww3_s4oq of _ { GHC.Types.F# x2_X2yj ->
               case g_a1sY of _ { GHC.Types.F# y2_X2yr ->
               case tx_a1t1 of _ { GHC.Types.F# y3_X2yn ->
               GHC.Types.F#
                 (GHC.Prim.plusFloat#
                    (GHC.Prim.plusFloat#
                       (GHC.Prim.plusFloat#
                          (GHC.Prim.timesFloat# x_a2sO y_a2sS)
                          (GHC.Prim.timesFloat# x1_X2y9 y1_X2yh))
                       (GHC.Prim.timesFloat# x2_X2yj y2_X2yr))
                    y3_X2yn)
               } } }}}}},
      
              <similar>,
              <similar> )
      
      This is pretty big, but inlining it does get rid of that F# allocation.
      But we'll also get rid of it with deep CPR: Trac #2289. For now we just
      accept the change.
      4fa3f16d
  12. 22 May, 2012 1 commit