Skip to content
Snippets Groups Projects
  1. Mar 20, 2021
    • Sebastian Graf's avatar
      Nested CPR light (#19398) · 044e5be3
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      While fixing #19232, it became increasingly clear that the vestigial
      hack described in `Note [Optimistic field binder CPR]` is complicated
      and causes reboxing. Rather than make the hack worse, this patch
      gets rid of it completely in favor of giving deeply unboxed parameters
      the Nested CPR property. Example:
      ```hs
      f :: (Int, Int) -> Int
      f p = case p of
       (x, y) | x == y    = x
              | otherwise = y
      ```
      Based on `p`'s `idDemandInfo` `1P(1P(L),1P(L))`, we can see that both
      fields of `p` will be available unboxed. As a result, we give `p` the
      nested CPR property `1(1,1)`. When analysing the `case`, the field
      CPRs are transferred to the binders `x` and `y`, respectively, so that
      we ultimately give `f` the CPR property.
      
      I took the liberty to do a bit of refactoring:
      
      - I renamed `CprResult` ("Constructed product result result") to plain
        `Cpr`.
      - I Introduced `FlatConCpr` in addition to (now nested) `ConCpr` and
        and according pattern synonym that rewrites flat `ConCpr` to
        `FlatConCpr`s, purely for compiler perf reasons.
      - Similarly for performance reasons, we now store binders with a
        Top signature in a separate `IntSet`,
        see `Note [Efficient Top sigs in SigEnv]`.
      - I moved a bit of stuff around in `GHC.Core.Opt.WorkWrap.Utils` and
        introduced `UnboxingDecision` to replace the `Maybe DataConPatContext`
        type we used to return from `wantToUnbox`.
      - Since the `Outputable Cpr` instance changed anyway, I removed the
        leading `m` which we used to emit for `ConCpr`. It's just noise,
        especially now that we may output nested CPRs.
      
      Fixes #19398.
      044e5be3
    • Andreas Klebinger's avatar
      Make the simplifier slightly stricter. · 62b0e1bc
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      This commit reduces allocations by the simplifier by 3% for the
      Cabal test at -O2.
      
      We do this by making a few select fields, bindings and arguments strict
      which reduces allocations for the simplifier by around 3% in total
      for the Cabal test. Which is about 2% fewer allocations in total at
      -O2.
      
      -------------------------
      Metric Decrease:
          T18698a
          T18698b
          T9233
          T9675
          T9872a
          T9872b
          T9872c
          T9872d
          T10421
          T12425
          T13253
          T5321FD
          T9961
      -------------------------
      62b0e1bc
    • Luite Stegeman's avatar
      Generate GHCi bytecode from STG instead of Core and support unboxed · 1f94e0f7
      Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
      tuples and sums.
      
      fixes #1257
      1f94e0f7
    • Luite Stegeman's avatar
      Transfer tickish things to GHC.Types.Tickish · 7de3532f
      Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
      Metric Increase:
          MultiLayerModules
      7de3532f
    • Luite Stegeman's avatar
      rename Tickish to CoreTickish · 0107f356
      Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
      0107f356
    • Luite Stegeman's avatar
      remove superfluous 'id' type parameter from GenTickish · 26328a68
      Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
      The 'id' type is now determined by the pass, using the XTickishId
      type family.
      26328a68
    • Luite Stegeman's avatar
      Save the type of breakpoints in the Breakpoint tick in STG · dd11f2d5
      Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
      GHCi needs to know the types of all breakpoints, but it's
      not possible to get the exprType of any expression in STG.
      
      This is preparation for the upcoming change to make GHCi
      bytecode from STG instead of Core.
      dd11f2d5
    • GHC GitLab CI's avatar
      testsuite: Normalise slashes · ceef490b
      GHC GitLab CI authored and Marge Bot's avatar Marge Bot committed
      In the `comments` and `literals` tests, since they contain file paths.
      ceef490b
    • GHC GitLab CI's avatar
      check-ppr,check-exact: Write out result as binary · adf93721
      GHC GitLab CI authored and Marge Bot's avatar Marge Bot committed
      Previously we would use `writeFile` to write the intermediate files to
      check for round-tripping. However, this will open the output handle as a
      text handle, which on Windows will change line endings. Avoid this by
      opening as binary.
      
      Explicitly use utf8 encoding.
      
      This is for tests only, do not need to worry about user compatibility.
      adf93721
    • Alan Zimmerman's avatar
      GHC Exactprint main commit · 95275a5f
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Metric Increase:
             T10370
             parsing001
      
      Updates haddock submodule
      95275a5f
    • Alan Zimmerman's avatar
      Add the main types to be used for exactprint in the GHC AST · f940fd46
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      The MR introducing the API Annotations, !2418 is huge.
      
      Conceptually it is two parts, the one deals with introducing the new
      types to be used for annotations, and outlining how they will be
      used.  This is a small change, localised to
      compiler/GHC/Parser/Annotation.hs and is contained in this commit.
      
      The follow-up, larger commit deals with mechanically working this
      through the entire AST and updating all the parts affected by it.
      
      It is being split so the part that needs good review feedback can be
      seen in isolation, prior to the rest coming in.
      f940fd46
    • Gaël Deest's avatar
      [skip ci] Fix 'Ord' documentation inconsistency · 7d027433
      Gaël Deest authored and Marge Bot's avatar Marge Bot committed
      Current documentation for the `Ord` typeclass is inconsistent. It
      simultaneously mentions that:
      
      > The 'Ord' class is used for totally ordered datatypes.
      
      And:
      
      > The Haskell Report defines no laws for 'Ord'. However, '<=' is
      > customarily expected to implement a non-strict partial order […]
      
      The Haskell report (both 98 and 2010 versions) mentions total ordering,
      which implicitly does define laws. Moreover, `compare :: Ord a => a -> a
      -> Ordering` and `data Ordering = LT | EQ | GT` imply that the order is
      indeed total (there is no way to say that two elements are not
      comparable). This MR fixes the Haddock comment, and adds a comparability
      law to the list of suggested properties.
      7d027433
  2. Mar 19, 2021
  3. Mar 17, 2021
  4. Mar 16, 2021
  5. Mar 15, 2021
  6. Mar 14, 2021
  7. Mar 13, 2021
Loading