1. 22 Sep, 2019 17 commits
  2. 21 Sep, 2019 3 commits
    • Sebastian Graf's avatar
      Get rid of PmFake · a7867c79
      Sebastian Graf authored
      The pattern match oracle can now cope with the abundance of information
      that ViewPatterns, NPlusKPats, overloaded lists, etc. provide.
      
      No need to have PmFake anymore!
      
      Also got rid of a spurious call to `allCompleteMatches`, which we used to call
      *for every constructor* match. Naturally this blows up quadratically for
      programs like `ManyAlternatives`.
      
      -------------------------
      Metric Decrease:
          ManyAlternatives
      
      Metric Increase:
          T11822
      -------------------------
      a7867c79
    • Ömer Sinan Ağacan's avatar
      Document MIN_PAYLOAD_SIZE and mark-compact GC mark bits · ded96fb3
      Ömer Sinan Ağacan authored
      This updates the documentation of the MIN_PAYLOAD_SIZE constant and adds
      a new Note [Mark bits in mark-compact collector] explaning why the
      mark-compact collector uses two bits per objet and why we need
      MIN_PAYLOAD_SIZE.
      ded96fb3
    • Sebastian Graf's avatar
      PredType for type constraints in the pattern match checker instead of EvVar · 1ea8c451
      Sebastian Graf authored
      Using EvVars for capturing type constraints implied side-effects in DsM
      when we just wanted to *construct* type constraints.
      
      But giving names to type constraints is only necessary when passing
      Givens to the type checker, of which the majority of the pattern match
      checker should be unaware.
      
      Thus, we simply generate `newtype TyCt = TyCt PredType`, which are
      nicely stateless. But at the same time this means we have to allocate
      EvVars when we want to query the type oracle! So we keep the type oracle
      state as `newtype TyState = TySt (Bag EvVar)`, which nicely makes a
      distinction between new, unchecked `TyCt`s and the inert set in
      `TyState`.
      1ea8c451
  3. 20 Sep, 2019 10 commits
    • Simon Peyton Jones's avatar
      Fix bogus type of case expression · 0dad81ca
      Simon Peyton Jones authored
      Issue #17056 revealed that we were sometimes building a case
      expression whose type field (in the Case constructor) was bogus.
      
      Consider a phantom type synonym
         type S a = Int
      and we want to form the case expression
         case x of K (a::*) -> (e :: S a)
      We must not make the type field of the Case constructor be (S a)
      because 'a' isn't in scope.  We must instead expand the synonym.
      
      Changes in this patch:
      
      * Expand synonyms in the new function CoreUtils.mkSingleAltCase.
      
      * Use mkSingleAltCase in MkCore.wrapFloat, which was the proximate
        source of the bug (when called by exprIsConApp_maybe)
      
      * Use mkSingleAltCase elsewhere
      
      * Documentation
          CoreSyn   new invariant (6) in Note [Case expression invariants]
          CoreSyn   Note [Why does Case have a 'Type' field?]
          CoreUtils Note [Care with the type of a case expression]
      
      * I improved Core Lint's error reporting, which was pretty
        confusing in this case, because it didn't mention that the offending
        type was the return type of a case expression.
      
      * A little bit of cosmetic refactoring in CoreUtils
      0dad81ca
    • Simon Peyton Jones's avatar
      Fix PmOracle.addVarCoreCt in-scope set · 17554248
      Simon Peyton Jones authored
      PmOracle.addVarCoreCt was giving a bogus (empty) in-scope set to
      exprIsConApp_maybe, which resulted in a substitution-invariant
      failure (see MR !1647 discussion).
      
      This patch fixes it, by taking the free vars of the expression.
      17554248
    • John Ericson's avatar
      Remove pointless partiality in `Parser.ajs` · 1b7e1d31
      John Ericson authored
      1b7e1d31
    • Matthew Pickering's avatar
      Pass -j to ghc-in-ghci CI job · 5390b553
      Matthew Pickering authored
      5390b553
    • Matthew Pickering's avatar
      Remove trailing whitespace · 070f7b85
      Matthew Pickering authored
      070f7b85
    • Matthew Pickering's avatar
      f257bf73
    • Ben Gamari's avatar
      testsuite: Add test for #17202 · 2f8ce45a
      Ben Gamari authored
      2f8ce45a
    • Sylvain Henry's avatar
      Module hierarchy: Hs (#13009) · 51192964
      Sylvain Henry authored
      Add GHC.Hs module hierarchy replacing hsSyn.
      
      Metric Increase:
          haddock.compiler
      51192964
    • Ben Gamari's avatar
      users guide: Fix link to let generalization blog post · 4853d962
      Ben Gamari authored
      Fixes #17200.
      4853d962
    • Alp Mestanogullari's avatar
      ErrUtils: split withTiming into withTiming and withTimingSilent · b3e5c731
      Alp Mestanogullari authored
      'withTiming' becomes a function that, when passed '-vN' (N >= 2) or
      '-ddump-timings', will print timing (and possibly allocations) related
      information. When additionally built with '-eventlog' and executed with
      '+RTS -l', 'withTiming' will also emit both 'traceMarker' and 'traceEvent'
      events to the eventlog.
      
      'withTimingSilent' on the other hand will never print any timing information,
      under any circumstance, and will only emit 'traceEvent' events to the eventlog.
      As pointed out in !1672, 'traceMarker' is better suited for things that we
      might want to visualize in tools like eventlog2html, while 'traceEvent'
      is better suited for internal events that occur a lot more often and that we
      don't necessarily want to visualize.
      
      This addresses #17138 by using 'withTimingSilent' for all the codegen bits
      that are expressed as a bunch of small computations over streams of codegen
      ASTs.
      b3e5c731
  4. 19 Sep, 2019 9 commits
    • Ben Gamari's avatar
      testsuite: Add testcase for #17206 · 52173990
      Ben Gamari authored
      52173990
    • Sebastian Graf's avatar
      Add a regression test for #11822 · 2a8867cf
      Sebastian Graf authored
      The particular test is already fixed, but the issue seems to have
      multiple different test cases lumped together.
      2a8867cf
    • Sebastian Graf's avatar
      Extract PmTypes module from PmExpr and PmOracle · baf47661
      Sebastian Graf authored
      Apparently ghc-lib-parser's API blew up because the newly induced cyclic
      dependency between TcRnTypes and PmOracle pulled in the other half of
      GHC into the relevant strongly-connected component.
      
      This patch arranges it so that PmTypes exposes mostly data type
      definitions and type class instances to be used within PmOracle, without
      importing the any of the possibly offending modules DsMonad, TcSimplify
      and FamInst.
      baf47661
    • Ben Gamari's avatar
      CoreUtils: Use mightBeUnliftedType in exprIsTopLevelBindable · 912afaf4
      Ben Gamari authored
      Also add reference from isUnliftedType to mightBeUnliftedType.
      912afaf4
    • Richard Eisenberg's avatar
      Test #17077. · c675d08f
      Richard Eisenberg authored
      c675d08f
    • Richard Eisenberg's avatar
      Use level numbers for generalisation · f594a68a
      Richard Eisenberg authored
      This fixes #15809, and is covered in
      Note [Use level numbers for quantification] in TcMType.
      
      This patch removes the "global tyvars" from the
      environment, a nice little win.
      f594a68a
    • Richard Eisenberg's avatar
      Refactor kindGeneralize and friends · d9c6b86e
      Richard Eisenberg authored
      This commit should have no change in behavior.(*)
      
      The observation was that Note [Recipe for checking a signature]
      says that every metavariable in a type-checked type must either
        (A) be generalized
        (B) be promoted
        (C) be zapped.
      Yet the code paths for doing these were all somewhat separate.
      This led to some steps being skipped. This commit shores this
      all up. The key innovation is TcHsType.kindGeneralizeSome, with
      appropriate commentary.
      
      This commit also sets the stage for #15809, by turning the
      WARNing about bad level-numbers in generalisation into an
      ASSERTion. The actual fix for #15809 will be in a separate
      commit.
      
      Other changes:
       * zonkPromoteType is now replaced by kindGeneralizeNone.
         This might have a small performance degradation, because
         zonkPromoteType zonked and promoted all at once. The new
         code path promotes first, and then zonks.
      
       * A call to kindGeneralizeNone was added in tcHsPartialSigType.
         I think this was a lurking bug, because it did not follow
         Note [Recipe for checking a signature]. I did not try to
         come up with an example showing the bug. This is the (*)
         above.
      
         Because of this change, there is an error message regression
         in partial-sigs/should_fail/T14040a. This problem isn't really
         a direct result of this refactoring, but is a symptom of
         something deeper. See #16775, which addresses the deeper
         problem.
      
       * I added a short-cut to quantifyTyVars, in case there's
         nothing to quantify.
      
       * There was a horribly-outdated Note that wasn't referred
         to. Gone now.
      
       * While poking around with T14040a, I discovered a small
         mistake in the Coercion.simplifyArgsWorker. Easy to fix,
         happily.
      
       * See new Note [Free vars in coercion hole] in TcMType.
         Previously, we were doing the wrong thing when looking
         at a coercion hole in the gather-candidates algorithm.
         Fixed now, with lengthy explanation.
      
      Metric Decrease:
        T14683
      d9c6b86e
    • Ben Gamari's avatar
      Simplify: Lazy pattern match · de1723b2
      Ben Gamari authored
      de1723b2
    • Simon Peyton Jones's avatar
      Add a missing update of sc_hole_ty (#16312) · c3eaaca6
      Simon Peyton Jones authored
      In simplCast I totally failed to keep the sc_hole_ty field of
      ApplyToTy (see Note [The hole type in ApplyToTy]) up to date.
      When a cast goes by, of course the hole type changes.
      
      Amazingly this has not bitten us before, but #16312 finally
      triggered it.  Fortunately the fix is simple.
      
      Fixes #16312.
      c3eaaca6
  5. 17 Sep, 2019 1 commit