[Git][ghc/ghc][wip/T21623] 15 commits: Demand: Clear distinction between Call SubDmd and eval Dmd (#21717)

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Sep 28 12:29:02 UTC 2022



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


Commits:
aeafdba5 by Sebastian Graf at 2022-09-27T15:14:54+02:00
Demand: Clear distinction between Call SubDmd and eval Dmd (#21717)

In #21717 we saw a reportedly unsound strictness signature due to an unsound
definition of plusSubDmd on Calls. This patch contains a description and the fix
to the unsoundness as outlined in `Note [Call SubDemand vs. evaluation Demand]`.

This fix means we also get rid of the special handling of `-fpedantic-bottoms`
in eta-reduction. Thanks to less strict and actually sound strictness results,
we will no longer eta-reduce the problematic cases in the first place, even
without `-fpedantic-bottoms`.

So fixing the unsoundness also makes our eta-reduction code simpler with less
hacks to explain. But there is another, more unfortunate side-effect:
We *unfix* #21085, but fortunately we have a new fix ready:
See `Note [mkCall and plusSubDmd]`.

There's another change:
I decided to make `Note [SubDemand denotes at least one evaluation]` a lot
simpler by using `plusSubDmd` (instead of `lubPlusSubDmd`) even if both argument
demands are lazy. That leads to less precise results, but in turn rids ourselves
from the need for 4 different `OpMode`s and the complication of
`Note [Manual specialisation of lub*Dmd/plus*Dmd]`. The result is simpler code
that is in line with the paper draft on Demand Analysis.

I left the abandoned idea in `Note [Unrealised opportunity in plusDmd]` for
posterity. The fallout in terms of regressions is negligible, as the testsuite
and NoFib shows.

```
        Program         Allocs    Instrs
--------------------------------------------------------------------------------
         hidden          +0.2%     -0.2%
         linear          -0.0%     -0.7%
--------------------------------------------------------------------------------
            Min          -0.0%     -0.7%
            Max          +0.2%     +0.0%
 Geometric Mean          +0.0%     -0.0%
```

Fixes #21717.

- - - - -
9b1595c8 by Ross Paterson at 2022-09-27T14:12:01-04:00
implement proposal 106 (Define Kinds Without Promotion) (fixes #6024)

includes corresponding changes to haddock submodule

- - - - -
8c06730f by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Start work

Not ready for review

More progress

Wibbles

Stage1 compiles

More wibbles

More wibbles

More -- almost working

Comments

Wibbles

Wibbles

Wibble inlineId

Wibbles

Infinite loop somewhere

More wibbles.  Maybe can build stage2

Make FuNCo a thing by itself

Wibble

Wibble

Wibbles

Fix OptCoercion

Wibble

Wibble to optCoercion

Replace SORT with TYPE and CONSTRAINT

Wibble

Delete unused import

Delete TypeOrConstraint from ghc-prim:GHC.Types

Move from NthCo to SelCo

Wibbles

Wibbles in RepType

Wibble

Add mkWpEta

Really add mkWpEta

Wibble Typeable binds etc

Improve error messages

More wibbles, mainly to error messages

Wibbles

Wibbles to errors

Wibbles

But especially: treat Constraint as Typeable

More wibbles

More changes

* Move role into SelTyCon
* Get rid of mkTcSymCo and friends

Unused variable

Wibbles

Wibble

Accept error message changes

Refactoring...

Remove tc functions like tcKind, tcGetTyVar.

Move tyConsOfType, occCheckExpand to TyCo.FVs.

Introduce GHC.Core.TyCo.Compare

Lots of import changes!

Update haddock submodule (I hope)

Wibbles (notably: actually add GHC.Core.TyCo.Compare)

Wibbles

Wibble output of T16575

Wibbles

More wibbles

Remove infinite loop in T1946

See Note [ForAllTy and type equality]

Deal with rejigConRes

Needs a Note to be written by Richard

Some renaming

AnonArgFlag -->  FunTyFlag
ArgFlag     -->  ForAllTyFlag

Update haddock submodule

Rename TyCoBinder to ForAllTyBinder

Wibbles

Update haddock

Wibble

Update unix submodule

I think I accidentally got it out of sync with HEAD;
this puts it back.

Rename TyCoBinder to PiTyBinder

Update Haddock submodule

Wrap dictionaries in tuples

This fixes the kind bugs in arrow desugaring.  Needs some Notes,
but I want to try CI.

More on boxing data cons

Rebase and update GHC.Tc.Errors/GHC.Tc.Errors.Ppr

- - - - -
8184267e by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Revert accidental changes in SameOccInfo

fixes mod180, tcfail182

- - - - -
0ce866f2 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Wibbles in error messages

..plus eqType comes from GHC.Core.TyCo.Compare

- - - - -
340e11d0 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Wibbles

- - - - -
e5f2c4bf by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
More wibbles

Reaedy for RAE review

- - - - -
91d3977a by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Fix fragile rule setup in GHC.Float

See Note [realToFrac natural-to-float]

- - - - -
44007e50 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Wibbles

- - - - -
ea61b140 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
More wibbles

- - - - -
5cbd5f61 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Remove unused import

- - - - -
e8a72c66 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Remove another unused import

- - - - -
e1f24093 by Simon Peyton Jones at 2022-09-28T12:26:16+01:00
Wibbles

- - - - -
a9f3f8a2 by Simon Peyton Jones at 2022-09-28T12:29:38+01:00
Update haddock submodule

- - - - -
d963b075 by Simon Peyton Jones at 2022-09-28T13:28:49+01:00
Respond to Sam's suggestions

- - - - -


16 changed files:

- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Types.hs-boot
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Types/Prim.hs
- − compiler/GHC/Builtin/Types/Prim.hs-boot
- compiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/ConLike.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e25f42f0cd0848e06ad840a6d4037e0d63ed4cd7...d963b07594a79cbf091cd8c080288824e179612d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e25f42f0cd0848e06ad840a6d4037e0d63ed4cd7...d963b07594a79cbf091cd8c080288824e179612d
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/20220928/4fe5c7a2/attachment.html>


More information about the ghc-commits mailing list