[Git][ghc/ghc][wip/T18502] 3 commits: Fix typo in haddock

Simon Peyton Jones gitlab at gitlab.haskell.org
Wed Jul 29 07:21:37 UTC 2020



Simon Peyton Jones pushed to branch wip/T18502 at Glasgow Haskell Compiler / GHC


Commits:
318bb17c by Oleg Grenrus at 2020-07-28T20:54:13-04:00
Fix typo in haddock

Spotted by `vilpan` on `#haskell`

- - - - -
39c89862 by Sergei Trofimovich at 2020-07-28T20:54:50-04:00
ghc/mk: don't build gmp packages for BIGNUM_BACKEND=native

Before this change make-based `BIGNUM_BACKEND=native` build was failing as:

```
x86_64-pc-linux-gnu-gcc: error: libraries/ghc-bignum/gmp/objs/*.o: No such file or directory
```

This happens because ghc.mk was pulling in gmp-dependent
ghc-bignum library unconditionally. The change avoid building
ghc-bignum.

Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/18437
Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -
749ec85e by Simon Peyton Jones at 2020-07-29T08:21:12+01:00
Add two bangs to improve perf of flattening

This tiny patch improves the compile time of flatten-heavy
programs by 1-2%, by adding two bangs.

Addresses (somewhat) #18502

This reduces allocation by
   T9872b   -1.1%
   T9872d   -3.3%

   T5321Fun -0.2%
   T5631    -0.2%
   T5837    +0.1%
   T6048    +0.1%

Metric Decrease:
    T9872b
    T9872d

- - - - -


3 changed files:

- compiler/GHC/Core/Coercion.hs
- ghc.mk
- libraries/base/GHC/IO.hs


Changes:

=====================================
compiler/GHC/Core/Coercion.hs
=====================================
@@ -1891,7 +1891,9 @@ substForAllCoBndrUsingLC sym sco (LC subst lc_env) tv co
 --
 --   For the inverse operation, see 'liftCoMatch'
 ty_co_subst :: LiftingContext -> Role -> Type -> Coercion
-ty_co_subst lc role ty
+ty_co_subst !lc role ty
+    -- !lc: making this function strict in lc allows callers to
+    -- pass its two components separately, rather than boxing them
   = go role ty
   where
     go :: Role -> Type -> Coercion
@@ -2864,9 +2866,9 @@ simplifyArgsWorker orig_ki_binders orig_inner_ki orig_fvs
          -- need a coercion (kind_co :: old_kind ~ new_kind).
          --
          -- The bangs here have been observed to improve performance
-         -- significantly in optimized builds.
-         let kind_co = mkSymCo $
-                       liftCoSubst Nominal lc (tyCoBinderType binder)
+         -- significantly in optimized builds; see #18502
+         let !kind_co = mkSymCo $
+                        liftCoSubst Nominal lc (tyCoBinderType binder)
              !casted_xi = xi `mkCastTy` kind_co
              casted_co =  mkCoherenceLeftCo role xi kind_co co
 


=====================================
ghc.mk
=====================================
@@ -656,7 +656,9 @@ BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1))
 BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0)))
 endif
 
+ifeq "$(BIGNUM_BACKEND)" "gmp"
 BUILD_DIRS += libraries/ghc-bignum/gmp
+endif
 BUILD_DIRS += utils/haddock
 BUILD_DIRS += utils/haddock/doc
 BUILD_DIRS += compiler


=====================================
libraries/base/GHC/IO.hs
=====================================
@@ -173,7 +173,7 @@ catchException !io handler = catch io handler
 -- @IO Int -> (ArithException -> IO Int) -> IO Int@ then the handler may
 -- get run with @DivideByZero@ as an argument, or an @ErrorCall \"urk\"@
 -- exception may be propagated further up. If you call it again, you
--- might get a the opposite behaviour. This is ok, because 'catch' is an
+-- might get the opposite behaviour. This is ok, because 'catch' is an
 -- 'IO' computation.
 --
 catch   :: Exception e



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/49d8597c9da32a5b674987cdc6ee227bcb627bb2...749ec85e74b98d70ba3aeed9440482e6000169c8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/49d8597c9da32a5b674987cdc6ee227bcb627bb2...749ec85e74b98d70ba3aeed9440482e6000169c8
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200729/f204fe76/attachment-0001.html>


More information about the ghc-commits mailing list