[Git][ghc/ghc][wip/T22516] 10 commits: Move hs_mulIntMayOflo cbits to ghc-prim

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Tue Nov 29 08:36:05 UTC 2022



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


Commits:
0eb1c331 by Cheng Shao at 2022-11-28T08:55:53+00:00
Move hs_mulIntMayOflo cbits to ghc-prim

It's only used by wasm NCG at the moment, but ghc-prim is a more
reasonable place for hosting out-of-line primops. Also, we only need a
single version of hs_mulIntMayOflo.

- - - - -
36b53a9d by Cheng Shao at 2022-11-28T09:05:57+00:00
compiler: generate ccalls for clz/ctz/popcnt in wasm NCG

We used to generate a single wasm clz/ctz/popcnt opcode, but it's
wrong when it comes to subwords, so might as well generate ccalls for
them. See #22470 for details.

- - - - -
d4134e92 by Cheng Shao at 2022-11-28T23:48:14-05:00
compiler: remove unused MO_U_MulMayOflo

We actually only emit MO_S_MulMayOflo and never emit MO_U_MulMayOflo anywhere.

- - - - -
8d15eadc by Apoorv Ingle at 2022-11-29T03:09:31-05:00
Killing cc_fundeps, streamlining kind equality orientation, and type equality processing order

Fixes: #217093
Associated to #19415

This change
* Flips the orientation of the the generated kind equality coercion in canEqLHSHetero;
* Removes `cc_fundeps` in CDictCan as the check was incomplete;
* Changes `canDecomposableTyConAppOk` to ensure we process kind equalities before type equalities and avoiding a call to `canEqLHSHetero` while processing wanted TyConApp equalities
* Adds 2 new tests for validating the change
   - testsuites/typecheck/should_compile/T21703.hs and
   - testsuites/typecheck/should_fail/T19415b.hs (a simpler version of T19415.hs)
* Misc: Due to the change in the equality direction some error messages now have flipped type mismatch errors
* Changes in Notes:
  - Note [Fundeps with instances, and equality orientation] supercedes Note [Fundeps with instances]
  - Added Note [Kind Equality Orientation] to visualize the kind flipping
  - Added Note [Decomposing Dependent TyCons and Processing Wanted Equalties]

- - - - -
646969d4 by Krzysztof Gogolewski at 2022-11-29T03:10:13-05:00
Change printing of sized literals to match the proposal

Literals in Core were printed as e.g. 0xFF#16 :: Int16#.
The proposal 451 now specifies syntax 0xFF#Int16.
This change affects the Core printer only - more to be done later.

Part of #21422.

- - - - -
02e282ec by Simon Peyton Jones at 2022-11-29T03:10:48-05:00
Be a bit more selective about floating bottoming expressions

This MR arranges to float a bottoming expression to the top
only if it escapes a value lambda.

See #22494 and Note [Floating to the top] in SetLevels.

This has a generally beneficial effect in nofib

+-------------------------------++----------+
|                               ||tsv (rel) |
+===============================++==========+
|           imaginary/paraffins ||   -0.93% |
|                imaginary/rfib ||   -0.05% |
|                      real/fem ||   -0.03% |
|                    real/fluid ||   -0.01% |
|                   real/fulsom ||   +0.05% |
|                   real/gamteb ||   -0.27% |
|                       real/gg ||   -0.10% |
|                   real/hidden ||   -0.01% |
|                      real/hpg ||   -0.03% |
|                      real/scs ||  -11.13% |
|         shootout/k-nucleotide ||   -0.01% |
|               shootout/n-body ||   -0.08% |
|   shootout/reverse-complement ||   -0.00% |
|        shootout/spectral-norm ||   -0.02% |
|             spectral/fibheaps ||   -0.20% |
|           spectral/hartel/fft ||   -1.04% |
|         spectral/hartel/solid ||   +0.33% |
|     spectral/hartel/wave4main ||   -0.35% |
|                 spectral/mate ||   +0.76% |
+===============================++==========+
|                     geom mean ||   -0.12% |

The effect on compile time is generally slightly beneficial

Metrics: compile_time/bytes allocated
----------------------------------------------
MultiLayerModulesTH_OneShot(normal)  +0.3%
                  PmSeriesG(normal)  -0.2%
                  PmSeriesT(normal)  -0.1%
                     T10421(normal)  -0.1%
                    T10421a(normal)  -0.1%
                     T10858(normal)  -0.1%
                     T11276(normal)  -0.1%
                    T11303b(normal)  -0.2%
                     T11545(normal)  -0.1%
                     T11822(normal)  -0.1%
                     T12150(optasm)  -0.1%
                     T12234(optasm)  -0.3%
                     T13035(normal)  -0.2%
                     T16190(normal)  -0.1%
                     T16875(normal)  -0.4%
                    T17836b(normal)  -0.2%
                     T17977(normal)  -0.2%
                    T17977b(normal)  -0.2%
                     T18140(normal)  -0.1%
                     T18282(normal)  -0.1%
                     T18304(normal)  -0.2%
                    T18698a(normal)  -0.1%
                     T18923(normal)  -0.1%
                     T20049(normal)  -0.1%
                    T21839r(normal)  -0.1%
                      T5837(normal)  -0.4%
                      T6048(optasm)  +3.2% BAD
                      T9198(normal)  -0.2%
                      T9630(normal)  -0.1%
       TcPlugin_RewritePerf(normal)  -0.4%
             hard_hole_fits(normal)  -0.1%

                          geo. mean  -0.0%
                          minimum    -0.4%
                          maximum    +3.2%

The T6048 outlier is hard to pin down, but it may be the effect of
reading in more interface files definitions. It's a small program for
which compile time is very short, so I'm not bothered about it.

Metric Increase:
    T6048

- - - - -
ab23dc5e by Ben Gamari at 2022-11-29T03:11:25-05:00
testsuite: Mark unpack_sums_6 as fragile due to #22504

This test is explicitly dependent upon runtime, which is generally not
appropriate given that the testsuite is run in parallel and generally
saturates the CPU.

- - - - -
def47dd3 by Ben Gamari at 2022-11-29T03:11:25-05:00
testsuite: Don't use grep -q in unpack_sums_7

`grep -q` closes stdin as soon as it finds the pattern it is looking
for, resulting in #22484.

- - - - -
b5d9558e by Simon Peyton Jones at 2022-11-29T08:37:50+00:00
Be more careful in GHC.Tc.Solver.Interact.solveOneFromTheOther

We were failing to account for the cc_pend_sc flag in this
important function, with the result that we expanded superclasses
forever.

Fixes #22516.

- - - - -
3e695c2b by Simon Peyton Jones at 2022-11-29T08:37:50+00:00
Use mkNakedFunTy in tcPatSynSig

As #22521 showed, in tcPatSynSig we make a "fake type" to
kind-generalise; and that type has unzonked type variables in it. So
we must not use `mkFunTy` (which checks FunTy's invariants) via
`mkPhiTy` when building this type.  Instead we need to use
`mkNakedFunTy`.

Easy fix.

- - - - -


30 changed files:

- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Rep.hs-boot
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Solver/Canonical.hs
- compiler/GHC/Tc/Solver/Interact.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Utils/Outputable.hs
- + libraries/ghc-prim/cbits/mulIntMayOflo.c
- libraries/ghc-prim/ghc-prim.cabal
- rts/rts.cabal.in
- − rts/wasm/Ops.c
- testsuite/tests/deSugar/should_compile/T2431.stderr
- testsuite/tests/indexed-types/should_fail/T3330c.stderr
- testsuite/tests/indexed-types/should_fail/T9662.stderr
- testsuite/tests/numeric/should_compile/T16402.stderr-ws-32
- testsuite/tests/numeric/should_compile/T16402.stderr-ws-64
- testsuite/tests/patsyn/should_compile/T21531.stderr
- + testsuite/tests/patsyn/should_compile/T22521.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/940e082f50f0050ec6cb0efdaeeb4523b8b78347...3e695c2bfd97095a44f69f03b607e05876bbdc11

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/940e082f50f0050ec6cb0efdaeeb4523b8b78347...3e695c2bfd97095a44f69f03b607e05876bbdc11
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/20221129/579725c6/attachment-0001.html>


More information about the ghc-commits mailing list