Skip to content
Snippets Groups Projects
  1. Oct 15, 2018
    • Tamar Christina's avatar
      Fix plugin tests requirements · 01c3d00a
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      Unfortunately the implementation has confused the ability to make
      dynamic libraries with dynamic way.
      This constraint is only true for systems that require `-fPIC` for
      shared libraries.
      
      Since the implementation has this implicit assumption, mark the tests
      as requiring dynway.
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5174
      01c3d00a
    • Ben Gamari's avatar
      Deprecate -fllvm-pass-vectors-in-regs · 58dffa0a
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      The behavior previously enabled by this flag is as been the default
      since 8.6.1.
      
      Reviewers: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5193
      58dffa0a
    • Nathan van Doorn's avatar
      f945b7ab
    • Ondra Pelech's avatar
    • Tobias Dammers's avatar
      Use an accumulator version of tyCoVarsOfType · 08b3db7e
      Tobias Dammers authored and Krzysztof Gogolewski's avatar Krzysztof Gogolewski committed
      Summary:
      This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of
      function, implementing them in terms of VarSet, but with accumulator-style
      (like in `FV`) built in, and with the same kind of pre-insert lookup; this
      has shown to perform better than either FV or plain VarSet in this particular
      scenario.
      
      Original notes from simonpj:
      
      In TyCoRep we now have tyCoVarsOfType implemented
      
      1) Using FV -- this is the baseline version in GHC today
      
      2) Using VarSets via unionVarSet
      
      3) Using VarSets in accumulator-style
      
      In this patch (3) is enabled.
      
      When compiling perf/compiler/T5631 we get
      
               Compiler allocs
         (1)   1,144M
         (2)   1,175M
         (3)   1,142M
      
      The key new insight in (3) is this:
      
        ty_co_vars_of_type (TyVarTy v) is acc
          | v `elemVarSet` is  = acc
          | v `elemVarSet` acc = acc   <---- NB!
          | otherwise          = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v)
      
      Notice the second line! If the variable is already in the
      accumulator, don't re-add it.  This makes big difference.
      Without it, allocation is 1,169M or so.
      
      One cause is that we only take the free vars of its kind once;
      that problem will go away when we do the main part of #14088 and
      close over kinds /afterwards/.  But still, another cause is perhaps
      that every insert into a set overwrites the previous item, and so
      allocates a new path to the item; it's not a no-op even if the
      item is there already.
      
      Why use (3) rather than (1)?  Becuase it just /has/ to
      be better;
      
      * FV carries around an InterestingVarFun, which does nothing
        useful here, but is tested at every variable
      
      * FV carries around a [Var] for the deterministic version.
      
      For this very hot operation (finding free vars) I think it
      makes sense to have speical purpose code.
      
      On the way I also simplified the (less used) coVarsOfType/Co family
      to use FV, by making serious use of the InterestingVarFun!
      
      Test Plan: validate, nofib
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14880
      
      Differential Revision: https://phabricator.haskell.org/D5141
      08b3db7e
    • Ryan Scott's avatar
      Fix #15725 with an extra Sym · 48efbc04
      Ryan Scott authored and Krzysztof Gogolewski's avatar Krzysztof Gogolewski committed
      Summary:
      We were adding a `Sym` to one argument in the `InstCo`
      case of `optCoercion` but not another, leading to the two arguments
      to misaligned when combined via `Trans`. This fixes the issue with
      a well targeted use of `wrapSym`.
      
      Test Plan: make test TEST=T15725
      
      Reviewers: goldfire, ningning, bgamari
      
      Reviewed By: goldfire, ningning
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15725
      
      Differential Revision: https://phabricator.haskell.org/D5217
      48efbc04
  2. Oct 14, 2018
  3. Oct 12, 2018
  4. Oct 11, 2018
    • Piyush P. Kurur's avatar
      Support builtin classes like KnownNat in backpack · ce7a1c4a
      Piyush P. Kurur authored
      This commit allows backpack signatures to enforce constraints like
      KnownNat
      on data types.  Thus it fixes #15379.  There were two important
      differences in the
      way GHC used to handle classes like KnowNat
      
      1.  Hand crafted instances of `KnownNat` were  forbidden, and
      
      2. The dictionary for an  instance `KnownNat T` was generated on the
      fly.
      
      For supporting backpack both these points have to be revisited.
      
      Disallowing instances of KnownNat
      --------------------------------------------
      
      Users were disallowed to declare instances of certain builtin classes
      like KnownNat for obvious safety reasons --- when we use the
      constraint like `KnownNat T`, we want T to be associated to a natural
      number. However, due to the reuse of this code while processing backpack
      signatures, `instance KnownNat T` were being disallowed even in module
      signature files.
      
      There is an important difference when it comes to instance declarations
      in a signature file. Consider the signature `Abstract` given below
      
      ```
      signature Abstract where
        data T :: Nat
        instance KnownNat T
      
      ```
      
      Inside a signature like `Abstract`, the `instance Known T` is not really
      creating an instance but rather demanding any module that implements
      this signature to enforce the constraint `KnownNat` on its type
      T.  While hand crafted KnownNat instances continued to be prohibited in
      modules,
      this commit ensures that it is not forbidden while handling signatures.
      
      Resolving Dictionaries
      ----------------------------
      
      Normally GHC expects any instance `T` of class `KnownNat` to eventually
      resolve
      to an integer and hence used to generate the evidence/dictionary for
      such instances
      on the fly as in when it is required. However, when backpack module and
      signatures are involved
      It is not always possible to resolve the type to a concrete integer
      utill the mixin stage. To illustrate
      consider again the  signature `Abstract`
      
      > signature Abstract where
      >   data T :: Nat
      >   instance KnownNat T
      
      and a module `Util` that depends on it:
      
      > module Util where
      >     import Abstract
      >     printT :: IO ()
      >     printT = do print $ natVal (Proxy :: Proxy T)
      
      Clearly, we need to "use" the dictionary associated with `KnownNat T`
      in the module `Util`, but it is too early for the compiler to produce
      a real dictionary as we still have not fixed what `T` is. Only when we
      mixin a concrete module
      
      > module Concrete where
      >   type T = 42
      
      do we really get hold of the underlying integer.
      
      In this commit, we make the following changes in the resolution of
      instance dictionary
      for constraints like `KnownNat T`
      
      1. If T is indeed available as a type alias for an integer constant,
         generate the dictionary on the fly as before, failing which
      
      2. Do not give up as before but look up the type class environment for
      the evidence.
      
      This was enough to make the resolution of `KnownNat` dictionaries work
      in the setting of Backpack as
      when actual code is generated, the signature Abstract (due to the
      `import Abstract` ) in `Util` gets
      replaced by an actual module like Concrete, and resolution happens as
      before.
      
      Everything that we said for `KnownNat` is applicable for `KnownSymbol`
      as well.
      
      Reviewers: bgamari, ezyang, goldfire, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, ezyang, rwbarton, thomie, carter
      
      GHC Trac Issues: #15379
      
      Differential Revision: https://phabricator.haskell.org/D4988
      ce7a1c4a
  5. Oct 10, 2018
    • Ömer Sinan Ağacan's avatar
      Re-enable test T14251 · 2f693b3e
      Ömer Sinan Ağacan authored
      (This change was accidentally reverted with the previous commit)
      2f693b3e
    • Ömer Sinan Ağacan's avatar
      Fix dataToTag# argument evaluation · ac977688
      Ömer Sinan Ağacan authored
      See #15696 for more details. We now always enter dataToTag# argument (done in
      generated Cmm, in StgCmmExpr). Any high-level optimisations on dataToTag#
      applications are done by the simplifier. Looking at tag bits (instead of
      reading the info table) for small types is left to another diff.
      
      Incorrect test T14626 is removed. We no longer do this optimisation (see
      comment:44, comment:45, comment:60).
      
      Comments and notes about special cases around dataToTag# are removed. We no
      longer have any special cases around it in Core.
      
      Other changes related to evaluating primops (seq# and dataToTag#) will be
      pursued in follow-up diffs.
      
      Test Plan: Validates with three regression tests
      
      Reviewers: simonpj, simonmar, hvr, bgamari, dfeuer
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15696
      
      Differential Revision: https://phabricator.haskell.org/D5201
      ac977688
  6. Oct 09, 2018
  7. Oct 07, 2018
  8. Oct 06, 2018
  9. Oct 05, 2018
  10. Oct 04, 2018
    • Ryan Scott's avatar
      Don't leak internal commentary into HasField's Haddocks · 89656c21
      Ryan Scott authored
      In commit 2f09753f, some internal comments about the kind
      signature of the HasField class accidentially leaked into its
      publicly exported Haddocks.
      89656c21
    • Alec Theriault's avatar
      Set `infixr -1 ->` · 251e3424
      Alec Theriault authored and Ryan Scott's avatar Ryan Scott committed
      Summary:
      This simply makes explicit what is already the case. Due to special
      treatment in the parser, `->` has the lowest fixity. This patch propagates
      that information to:
      
        * GHCi, where `:info ->` now return the right fixity
        * TH, where `reifyFixity` returns the right fixity
        * the generated sources for `GHC.Prim`
      
      See #15235.
      
      Test Plan: make test
      
      Reviewers: bgamari, alanz, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: int-index, RyanGlScott, rwbarton, mpickering, carter
      
      GHC Trac Issues: #15235
      
      Differential Revision: https://phabricator.haskell.org/D5199
      251e3424
    • Alec Theriault's avatar
      Don't drop arguments in TH type arguments · ba163c3b
      Alec Theriault authored and Ryan Scott's avatar Ryan Scott committed
      Summary:
      When converting from TH AST back to HsType, we were occasionally
      dropping type arguments. This resulted in incorrectly accepted programs
      as well as incorrectly rejected programs.
      
      Test Plan: make TEST=T15360a && make TEST=T15360b
      
      Reviewers: goldfire, bgamari, tdammers
      
      Reviewed By: bgamari, tdammers
      
      Subscribers: RyanGlScott, rwbarton, carter
      
      GHC Trac Issues: #15360
      
      Differential Revision: https://phabricator.haskell.org/D5188
      ba163c3b
    • Alec Theriault's avatar
      Allow (unparenthesized) kind signatures · bace26aa
      Alec Theriault authored and Ryan Scott's avatar Ryan Scott committed
      Summary: This allows for things like `[t :: MyKind]`, `(a :: k, b)`, and so on.
      
      Test Plan: make TEST=T11622 && make TEST=T8708
      
      Reviewers: RyanGlScott, bgamari, simonpj, goldfire, alanz
      
      Reviewed By: RyanGlScott, simonpj
      
      Subscribers: alanz, simonpj, rwbarton, mpickering, carter
      
      GHC Trac Issues: #11622, #8708
      
      Differential Revision: https://phabricator.haskell.org/D5173
      bace26aa
    • Alec Theriault's avatar
      Documentation fixes in 'template-haskell' · 85376570
      Alec Theriault authored and Ryan Scott's avatar Ryan Scott committed
      Summary:
       * Clarify the non-presence of derived classes in reified decls (#15167)
       * Clarify the shallowness of "reifyInstances" (#7066)
       * Mention that 'Typeable' instances are not found by reifyInstances (#11251)
       * Various Haddock markup issues fixed
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15167, #7066, #11251
      
      Differential Revision: https://phabricator.haskell.org/D5197
      85376570
    • Alec Theriault's avatar
      Improve generated `GHC.Prim` docs · feb8a671
      Alec Theriault authored and Ryan Scott's avatar Ryan Scott committed
      Summary:
      * Extended `genprimcode` to generate Haddock-compatible deprecations,
        as well as displaying information about which functions are LLVM-only
        and which functions can fail with an unchecked exception.
      
      * Ported existing deprecations to the new format, and also added a
        deprecation on `par#` (see Trac #15227).
      
      * Emit an error on fixity/deprecation of builtins, unless we are
        processing the module in which that name is defined (see Trac #15233).
        That means the following is no longer accepted (outside of `GHC.Types`):
      
      ```
      infixr 7 :
      {-# DEPRECATED (:) "cons is deprecated" #-}
      ```
      
      * Generate `data (->) a b` with docs and fixity in `GHC.Prim`. This
        means: GHC can now parse `data (->) a b` and `infixr 0 ->` (only in
        `GHC.Prim`) and `genprimcode` can digest `primtype (->) a b` (See Trac
        #4861)
      
      as well as some misc fixes along the way.
      
      Reviewers: bgamari, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, rwbarton, mpickering, carter
      
      GHC Trac Issues: #15227, #15233, #4861
      
      Differential Revision: https://phabricator.haskell.org/D5167
      feb8a671
    • Alec Theriault's avatar
      Document the list data type · 60b547b5
      Alec Theriault authored and Ryan Scott's avatar Ryan Scott committed
      Summary: Also qualified some identifier hyperlinks along the way.
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #4861
      
      Differential Revision: https://phabricator.haskell.org/D5158
      60b547b5
Loading