1. 11 Jun, 2014 1 commit
    • eir@cis.upenn.edu's avatar
      Fix #9062. · e79e2c39
      eir@cis.upenn.edu authored
      Removed (pprEqPred (coercionKind co)) in favor of
      (pprType (coercionType co)).
      
      Also had to make "~R#" a *symbolic* identifier and BuiltInSyntax
      to squelch prefix notation and module prefixes in output. These
      changes are both sensible independent of #9062.
      e79e2c39
  2. 15 May, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add LANGUAGE pragmas to compiler/ source files · 23892440
      Herbert Valerio Riedel authored
      In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
      reorganized, while following the convention, to
      
      - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
        any `{-# OPTIONS_GHC #-}`-lines.
      
      - Moreover, if the list of language extensions fit into a single
        `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
        line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
        individual language extension. In both cases, try to keep the
        enumeration alphabetically ordered.
        (The latter layout is preferable as it's more diff-friendly)
      
      While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
      occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
      23892440
  3. 08 May, 2014 1 commit
  4. 17 Dec, 2013 1 commit
  5. 12 Dec, 2013 1 commit
  6. 29 Nov, 2013 1 commit
  7. 27 Nov, 2013 1 commit
  8. 21 Nov, 2013 1 commit
  9. 12 Nov, 2013 1 commit
  10. 23 Sep, 2013 1 commit
  11. 29 Aug, 2013 2 commits
  12. 19 Aug, 2013 2 commits
  13. 02 Aug, 2013 1 commit
  14. 06 Jun, 2013 2 commits
  15. 13 Feb, 2013 1 commit
  16. 30 Jan, 2013 1 commit
  17. 22 Jan, 2013 1 commit
  18. 02 Jan, 2013 1 commit
  19. 24 Dec, 2012 1 commit
  20. 15 Oct, 2012 1 commit
    • Simon Peyton Jones's avatar
      Use isCheapApp in exprIsWorkFree · 81594da5
      Simon Peyton Jones authored
      exprIsWorkFree was returning False for constructor applications
      like (Just x).  Horror!  Now we delegate to isCheapApp, which does the
      right thing.
      
      I found this (by accident) when seeing why the simplifier was taking
      more iterations than I expected.  So not only should we generate
      better code as a result, but perhaps with fewer simplifier iterations.
      General happiness.
      81594da5
  21. 17 Sep, 2012 1 commit
  22. 28 Aug, 2012 1 commit
  23. 02 Aug, 2012 1 commit
  24. 20 Jul, 2012 1 commit
  25. 27 Jun, 2012 1 commit
    • Simon Peyton Jones's avatar
      Add silent superclass parameters (again) · aa1e0976
      Simon Peyton Jones authored
      Silent superclass parameters solve the problem that
      the superclasses of a dicionary construction can easily
      turn out to be (wrongly) bottom.  The problem and solution
      are described in
         Note [Silent superclass arguments] in TcInstDcls
      
      I first implemented this fix (with Dimitrios) in Dec 2010, but removed
      it again in Jun 2011 becuase we thought it wasn't necessary any
      more. (The reason we thought it wasn't necessary is that we'd stopped
      generating derived superclass constraints for *wanteds*.  But we were
      wrong; that didn't solve the superclass-loop problem.)
      
      So we have to re-implement it.  It's not hard.  Main features:
      
        * The IdDetails for a DFunId says how many silent arguments it has
      
        * A DFunUnfolding describes which dictionary args are
          just parameters (DFunLamArg) and which are a function to apply
          to the parameters (DFunPolyArg).  This adds the DFunArg type
          to CoreSyn
      
        * Consequential changes to IfaceSyn.  (Binary hi file format changes
          slightly.)
      
        * TcInstDcls changes to generate the right dfuns
      
        * CoreSubst.exprIsConApp_maybe handles the new DFunUnfolding
      
      The thing taht is *not* done yet is to alter the vectoriser to
      pass the relevant extra argument when building a PA dictionary.
      aa1e0976
  26. 16 May, 2012 1 commit
    • Simon Peyton Jones's avatar
      When comparing Case expressions, take account of empty alternatives · ebcad764
      Simon Peyton Jones authored
      After the recent change that allows empty case alternatives, we
      were accidentally saying that these two were equal:
         Case x _ Int  []
         Case x _ Bool []
      Usually if the alternatives are equal so is the result type -- but
      not if the alternatives are empty!
      
      There are two places to fix:
        CoreUtils.eqExpr
        TrieMap with CoreExpr key
      
      Fixes #6096, #6097
      ebcad764
  27. 09 May, 2012 1 commit
    • Simon Peyton Jones's avatar
      Be a little less aggressive about inlining (fixes Trac #5623) · 2112f43c
      Simon Peyton Jones authored
      When inlining, we are making a copy of the expression, so we have to
      be careful about duplicating work.  Previously we were using
      exprIsCheap for that, but it is willing to duplicate a cheap primop --
      and that is terribly bad if it happens inside some inner array loop
      (Trac #5623).  So now we use a new function exprIsWorkFree.  Even
      then there is some wiggle room:
         see Note [exprIsWorkFree] in CoreUtils
      
      This commit does make wheel-sieve1 allocate a lot more, but we decided
      that's just tough; it's more important for inlining to be robust
      about not duplicating work.
      2112f43c
  28. 07 May, 2012 1 commit
    • Simon Peyton Jones's avatar
      Yet another major refactoring of the constraint solver · dd7522c3
      Simon Peyton Jones authored
      This is the result of Simon and Dimitrios doing a code walk through.
      There is no change in behaviour, but the structure is much better.
      Main changes:
      
      * Given constraints contain an EvTerm not an EvVar
      
      * Correspondingly, TcEvidence is a recursive types that uses
        EvTerms rather than EvVars
      
      * Rename CtFlavor to CtEvidence
      
      * Every CtEvidence has a ctev_pred field.  And use record fields
        consistently for CtEvidence
      
      * The solved-constraint fields of InertSet (namely inert_solved and
        inert_solved_funeqs) contain CtEvidence, not Ct
      
      There is a long cascade of follow-on changes.
      dd7522c3
  29. 27 Apr, 2012 2 commits
    • Simon Peyton Jones's avatar
      Revert "Refactoring in CoreUtils/CoreArity" · a2ae0d77
      Simon Peyton Jones authored
      This reverts commit e3f8557c.
      
      Sigh. Seg fault.
      a2ae0d77
    • Simon Peyton Jones's avatar
      Refactoring in CoreUtils/CoreArity · e3f8557c
      Simon Peyton Jones authored
      In the previous commit about "aggressive primops" I wanted a new
      function CoreUtils.exprCertainlyTerminates.  In doing this I ended up
      with a significant refactoring in CoreUtils.  The new structure has
      quite a lot of nice sharing:
      
               exprIsCheap             = exprIsCheap' isHNFApp
               exprIsExpandable        = exprIsCheap' isConLikeApp
      
               exprIsHNF               = exprIsHNFlike isHNFApp
               exprIsConLike           = exprIsHNFlike isConLikeApp
               exprCertainlyTerminates = exprIsHNFlike isTerminatingApp
      
      This patch also does some renaming
      
          CheapAppFun      -->   FunAppAnalyser
          isCheapApp       -->   isHNFApp
          isExpandableApp  -->   isConLikeApp
      e3f8557c
  30. 26 Apr, 2012 1 commit
  31. 30 Mar, 2012 1 commit
  32. 21 Mar, 2012 1 commit
    • batterseapower's avatar
      Make impossible-alternative-finding code more reusable · aecacda1
      batterseapower authored
      Makes the following changes:
       1. Generalises the type signatures of some functions relating to alternatives
          so that the type of "variables" and "expression" is not specified
       2. Puts the bulk of the alternative-filtering code into a new function filterAlts
          (in CoreUtils) that can be used outside of the SimplM monad
       3. Allows prepareAlts to return a null alternatives list if none are applicable -
          it turns out that this case was already handled by the caller (in the simplifier).
          This should result in a modest optimisation improvement in some cases.
      
      Conflicts:
      
      	compiler/coreSyn/CoreUtils.lhs
      	compiler/simplCore/SimplUtils.lhs
      aecacda1
  33. 16 Jan, 2012 1 commit
  34. 13 Jan, 2012 1 commit
    • Simon Peyton Jones's avatar
      Add -faggressive-primops plus refactoring in CoreUtils · 601c983d
      Simon Peyton Jones authored
      I'm experimenting with making GHC a bit more aggressive about
        a) dropping case expressions if the result is unused
              Simplify.rebuildCase, CaseElim equation
      
        b) floating case expressions inwards
              FloatIn.fiExpr, AnnCase
      
      In both cases the new behaviour is gotten with a static (debug)
      flag -faggressive-primops.  The extra "aggression" is to allow
      discarding and floating in for side-effecting operations.  See
      the new, extensive Note [PrimOp can_fail and has_side_effects]
      in PrimoOp.
      
      When discarding a case with unused binders, in the lifted-type
      case it's definitely ok if the scrutinee terminates; previously
      we were checking exprOkForSpeculation, which is significantly
      worse.
      
      So I wanted a new function CoreUtils.exprCertainlyTerminates.
      In doing this I ended up with a significant refactoring in
      CoreUtils.  The new structure has quite a lot of nice sharing:
      
          exprIsCheap             = exprIsCheap' isHNFApp
          exprIsExpandable        = exprIsCheap' isConLikeApp
      
          exprIsHNF               = exprIsHNFlike isHNFApp
          exprIsConLike           = exprIsHNFlike isConLikeApp
          exprCertainlyTerminates = exprIsHNFlike isTerminatingApp
      601c983d
  35. 12 Jan, 2012 1 commit
    • Simon Peyton Jones's avatar
      Fix Trac #5658: strict bindings not floated in · 3beb1a83
      Simon Peyton Jones authored
      Two changes here
      
      * The main change here is to enhance the FloatIn pass so that it can
        float case-bindings inwards.  In particular the case bindings for
        array indexing.
      
      * Also change the code in Simplify, to allow a case on array
        indexing (ie can_fail is true) to be discarded altogether if its
        results are unused.
      
      Lots of new comments in PrimOp about can_fail and has_side_effects
      
      Some refactoring to share the FloatBind data structure between
      FloatIn and FloatOut
      3beb1a83
  36. 09 Jan, 2012 1 commit