[Git][ghc/ghc][wip/t23703] 7 commits: configure: Derive library version from ghc-prim.cabal.in

Finley McIlwaine (@FinleyMcIlwaine) gitlab at gitlab.haskell.org
Tue Aug 8 16:54:08 UTC 2023



Finley McIlwaine pushed to branch wip/t23703 at Glasgow Haskell Compiler / GHC


Commits:
01961be3 by Ben Gamari at 2023-08-08T02:47:14-04:00
configure: Derive library version from ghc-prim.cabal.in

Since ghc-prim.cabal is now generated by Hadrian, we cannot depend upon
it.

Closes #23726.

- - - - -
3b373838 by Ryan Scott at 2023-08-08T02:47:49-04:00
tcExpr: Push expected types for untyped TH splices inwards

In !10911, I deleted a `tcExpr` case for `HsUntypedSplice` in favor of a much
simpler case that simply delegates to `tcApp`. Although this passed the test
suite at the time, this was actually an error, as the previous `tcExpr` case
was critically pushing the expected type inwards. This actually matters for
programs like the one in #23796, which GHC would not accept with type inference
alone—we need full-blown type _checking_ to accept these.

I have added back the previous `tcExpr` case for `HsUntypedSplice` and now
explain why we have two different `HsUntypedSplice` cases (one in `tcExpr` and
another in `splitHsApps`) in `Note [Looking through Template Haskell splices in
splitHsApps]` in `GHC.Tc.Gen.Head`.

Fixes #23796.

- - - - -
7b864da6 by Finley McIlwaine at 2023-08-08T09:23:24-06:00
Add -dipe-stats flag

This is useful for seeing which info tables have information.

- - - - -
5f9f4306 by Finley McIlwaine at 2023-08-08T09:23:24-06:00
Add -finfo-table-map-with-fallback -finfo-table-map-with-stack

The -fno-info-table-map-with-stack flag omits STACK info tables from the info
table map, and the -fno-info-table-map-with-fallback flag omits info tables
with defaulted source locations from the map. In a test on the Agda codebase
the build results were about 7% smaller when both of those types of tables
were omitted.

Adds a test that verifies that passing each combination of these flags
results in the correct output for -dipe-stats.

This commit also refactors a lot of the logic around extracting info tables
from the Cmm results and building the info table map.

This commit also fixes some issues in the users guide rst source to fix
warnings that were noticed while debugging the documentation for these flags.

Fixes #23702

- - - - -
a4b0bc72 by Finley McIlwaine at 2023-08-08T10:03:16-06:00
Refactor estimation of stack info table provenance

This commit greatly refactors the way we compute estimated provenance for stack
info tables. Previously, this process was done using an entirely separate traversal
of the whole Cmm code stream to build the map from info tables to source locations.
The separate traversal is now fused with the Cmm code generation pipeline in
GHC.Driver.Main.

This results in very significant code generation speed ups when -finfo-table-map is
enabled. In testing, this patch reduces code generation times by almost 30% with
-finfo-table-map and -O0, and 60% with -finfo-table-map and -O1 or -O2 .

Fixes #23103

- - - - -
e3950bc7 by Finley McIlwaine at 2023-08-08T10:11:07-06:00
Refactor distinct constructor tables map construction

Adds `GHC.Types.Unique.Map.alterUniqMap_L`, `GHC.Types.Unique.FM.alterUFM_L`,
`GHC.Data.Word64Map.alterLookupWithKey` to support fusion of distinct
constructor data insertion and lookup during the construction of the data con
map in `GHC.Stg.Debug.numberDataCon`.

- - - - -
16b05041 by Finley McIlwaine at 2023-08-08T10:53:21-06:00
Allow per constructor refinement of distinct-constructor-tables

Introduce `-fno-distinct-constructor-tables`. A distinct constructor table
configuration is built from the combination of flags given, in order. For
example, to create distinct constructor tables for all constructors except for a
specific few named `C1`,..., `CN`, pass `-fdistinct-contructor-tables` followed
by `fno-distinct-constructor-tables=C1,...,CN`. To only generate distinct
constuctor tables for a few specific constructors and no others, just pass
`-fdistinct-constructor-tables=C1,...,CN`.

The various configuations of these flags is included in the dynflags
fingerprints, which should result in the expected recompilation logic.

Adds a test that checks for distinct tables for various given or omitted
constructors.

Updates CountDepsAst and CountDepsParser tests to account for new dependencies.

Fixes #23703

- - - - -


29 changed files:

- compiler/GHC/Cmm.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Driver/Config/Stg/Debug.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Iface/Recomp/Flags.hs
- compiler/GHC/Runtime/Heap/Layout.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/StgToCmm/Config.hs
- compiler/GHC/StgToCmm/Prof.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Map.hs
- configure.ac
- docs/users_guide/9.10.1-notes.rst
- docs/users_guide/9.8.1-notes.rst
- docs/users_guide/debug-info.rst
- docs/users_guide/debugging.rst
- docs/users_guide/exts/implicit_parameters.rst
- docs/users_guide/phases.rst
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7093fcdbcd8d988c0817da1bae4a9ef0cbb73f5b...16b050419bc9b57e91567fe2d94827bc520d1fb2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7093fcdbcd8d988c0817da1bae4a9ef0cbb73f5b...16b050419bc9b57e91567fe2d94827bc520d1fb2
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/20230808/088c51ec/attachment.html>


More information about the ghc-commits mailing list