[Git][ghc/ghc][wip/sand-witch/types-in-terms] 54 commits: AArch64: Simplify BL instruction
Andrei Borzenkov (@sand-witch)
gitlab at gitlab.haskell.org
Fri Jun 28 15:47:37 UTC 2024
Andrei Borzenkov pushed to branch wip/sand-witch/types-in-terms at Glasgow Haskell Compiler / GHC
Commits:
eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00
AArch64: Simplify BL instruction
The BL constructor carried unused data in its third argument.
- - - - -
b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00
TTG: Move SourceText from `Fixity` to `FixitySig`
It is only used there, simplifies the use of `Fixity` in the rest of
the code, and is moved into a TTG extension point.
Precedes !12842, to simplify it
- - - - -
842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00
base: Deprecate some .Internal modules
Deprecates the following modules according to clc-proposal #217:
https://github.com/haskell/core-libraries-committee/issues/217
* GHC.TypeNats.Internal
* GHC.TypeLits.Internal
* GHC.ExecutionStack.Internal
Closes #24998
- - - - -
24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00
ttg: Use List instead of Bag in AST for LHsBindsLR
Considering that the parser used to create a Bag of binds using a
cons-based approach, it can be also done using lists. The operations in
the compiler don't really require Bag.
By using lists, there is no dependency on GHC.Data.Bag anymore from the
AST.
Progress towards #21592
- - - - -
04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00
Fix untouchability test
This MR fixes #24938. The underlying problem was tha the test for
"does this implication bring in scope any equalities" was plain wrong.
See
Note [Tracking Given equalities] and
Note [Let-bound skolems]
both in GHC.Tc.Solver.InertSet.
Then
* Test LocalGivenEqs succeeds for a different reason than before;
see (LBS2) in Note [Let-bound skolems]
* New test T24938a succeeds because of (LBS2), whereas it failed
before.
* Test LocalGivenEqs2 now fails, as it should.
* Test T224938, the repro from the ticket, fails, as it should.
- - - - -
9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00
Fix demand signatures for join points
This MR tackles #24623 and #23113
The main change is to give a clearer notion of "worker/wrapper arity", esp
for join points. See GHC.Core.Opt.DmdAnal
Note [Worker/wrapper arity and join points]
This Note is a good summary of what this MR does:
(1) The "worker/wrapper arity" of an Id is
* For non-join-points: idArity
* The join points: the join arity (Id part only of course)
This is the number of args we will use in worker/wrapper.
See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`.
(2) A join point's demand-signature arity may exceed the Id's worker/wrapper
arity. See the `arity_ok` assertion in `mkWwBodies`.
(3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond
the worker/wrapper arity.
(4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper
arity (re)-computed by workWrapArity.
- - - - -
5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00
Update haddocks of Import/Export AST types
- - - - -
cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00
haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project
- - - - -
8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00
cmm: Don't parse MO_BSwap for W8
Don't support parsing bswap8, since bswap8 is not really an operation
and would have to be implemented as a no-op (and currently is not
implemented at all).
Fixes #25002
- - - - -
5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00
Delete unused testsuite files
These files were committed by mistake in !11902.
This commit simply removes them.
- - - - -
7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00
Remove left over debugging pragma from 2016
This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147
The top-level cost centres lead to a lack of optimisation when compiling
with profiling.
- - - - -
c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00
haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default
This commit enables some extensions and GHC flags in the cabal file in a way
that allows us to reduce the amount of prologuing on top of each file.
We also prefix the usage of some List functions that removes ambiguity
when they are also exported from the Prelude, like foldl'.
In general, this has the effect of pointing out more explicitly
that a linked list is used.
Metric Increase:
haddock.Cabal
haddock.base
haddock.compiler
- - - - -
8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00
Add test case for #23586
- - - - -
568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00
When matching functions in rewrite rules: ignore multiplicity
When matching a template variable to an expression, we check that it
has the same type as the matched expression. But if the variable `f` has
type `A -> B` while the expression `e` has type `A %1 -> B`, the match was
previously rejected.
A principled solution would have `f` substituted by `\(%Many x) -> e
x` or some other appropriate coercion. But since linearity is not
properly checked in Core, we can be cheeky and simply ignore
multiplicity while matching. Much easier.
This has forced a change in the linter which, when `-dlinear-core-lint`
is off, must consider that `a -> b` and `a %1 -> b` are equal. This is
achieved by adding an argument to configure the behaviour of
`nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour
which ignores multiplicities when comparing two `FunTy`.
Fixes #24725.
- - - - -
c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00
Faster type equality
This MR speeds up type equality, triggered by perf regressions that
showed up when fixing #24725 by parameterising type equality over
whether to ignore multiplicity.
The changes are:
* Do not use `nonDetCmpType` for type /equality/. Instead use a specialised
type-equality function, which we have always had!
`nonDetCmpType` remains, but I did not invest effort in refactoring
or optimising it.
* Type equality is parameterised by
- whether to expand synonyms
- whether to respect multiplicities
- whether it has a RnEnv2 environment
In this MR I systematically specialise it for static values of these
parameters. Much more direct and predictable than before. See
Note [Specialising type equality]
* We want to avoid comparing kinds if possible. I refactored how this
happens, at least for `eqType`.
See Note [Casts and coercions in type comparison]
* To make Lint fast, we want to avoid allocating a thunk for <msg> in
ensureEqTypes ty1 ty2 <msg>
because the test almost always succeeds, and <msg> isn't needed.
See Note [INLINE ensureEqTys]
Metric Decrease:
T13386
T5030
- - - - -
21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00
base: Add inits1 and tails1 to Data.List
- - - - -
d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00
Derive previously hand-written `Lift` instances (#14030)
This is possible now that #22229 is fixed.
- - - - -
33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00
Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030)
After #22229 had been fixed, we can finally derive the `Lift` instance for the
TH AST, as proposed by Ryan Scott in
https://mail.haskell.org/pipermail/libraries/2015-September/026117.html.
Fixes #14030, #14296, #21759 and #24560.
The residency of T24471 increases by 13% because we now load `AnnLookup`
from its interface file, which transitively loads the whole TH AST.
Unavoidable and not terrible, I think.
Metric Increase:
T24471
- - - - -
383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00
bindist: Use complete relative paths when cding to directories
If a user has configured CDPATH on their system then `cd lib` may change
into an unexpected directory during the installation process.
If you write `cd ./lib` then it will not consult `CDPATH` to determine
what you mean.
I have added a check on ghcup-ci to verify that the bindist installation
works in this situation.
Fixes #24951
- - - - -
5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00
haddock: Use the more precise SDocContext instead of DynFlags
The pervasive usage of DynFlags (the parsed command-line options passed
to ghc) blurs the border between different components of Haddock, and
especially those that focus solely on printing text on the screen.
In order to improve the understanding of the real dependencies of a
function, the pretty-printer options are made concrete earlier in the
pipeline instead of late when pretty-printing happens.
This also has the advantage of clarifying which functions actually
require DynFlags for purposes other than pretty-printing, thus making
the interactions between Haddock and GHC more understandable when
exploring the code base.
See Henry, Ericson, Young. "Modularizing GHC".
https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022
- - - - -
749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00
Add INLINE [1] pragma to compareInt / compareWord
To allow rules to be written on the concrete implementation of
`compare` for `Int` and `Word`, we need to have an `INLINE [1]`
pragma on these functions, following the
`matching_overloaded_methods_in_rules` note in `GHC.Classes`.
CLC proposal https://github.com/haskell/core-libraries-committee/issues/179
Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643
- - - - -
db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
ci: Enable strict ghc-toolchain setting for bindists
- - - - -
14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
ghc-toolchain: Improve parse failure error
Improves the error message for when `ghc-toolchain` fails to read a
valid `Target` value from a file (in doFormat mode).
- - - - -
6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
bindist: ghc-toolchain related options in configure
- - - - -
958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00
ci: Fail when bindist configure fails when installing bindist
It is better to fail earlier if the configure step fails rather than
carrying on for a more obscure error message.
- - - - -
f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
ghc-toolchain: Fix error logging indentation
- - - - -
f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
bindist: Correct default.target substitution
The substitution on `default.target.in` must be done after
`PREP_TARGET_FILE` is called -- that macro is responsible for
setting the variables that will be effectively substituted in the target
file. Otherwise, the target file is invalid.
Fixes #24792 #24574
- - - - -
665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
configure: Prefer tool name over tool path
It is non-obvious whether the toolchain configuration should use
full-paths to tools or simply their names. In addressing #24574, we've
decided to prefer executable names over paths, ultimately, because the
bindist configure script already does this, thus is the default in ghcs
out there.
Updates the in-tree configure script to prefer tool names
(`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to
ignore the full-path-result of `findExecutable`, which it previously
used over the program name.
This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc
because `AC_CHECK_TOOL` still takes into account the target triples,
unlike `AC_CHECK_PROG/AC_PATH_PROG`.
- - - - -
463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
dist: Don't forget to configure JavascriptCPP
We introduced a configuration step for the javascript preprocessor, but
only did so for the in-tree configure script.
This commit makes it so that we also configure the javascript
preprocessor in the configure shipped in the compiler bindist.
- - - - -
e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00
distrib: LlvmTarget in distrib/configure
LlvmTarget was being set and substituted in the in-tree configure, but
not in the configure shipped in the bindist.
We want to set the LlvmTarget to the canonical LLVM name of the platform
that GHC is targetting.
Currently, that is going to be the boostrapped llvm target (hence the
code which sets LlvmTarget=bootstrap_llvm_target).
- - - - -
4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00
Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10)
- - - - -
f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00
ci: Add 9_10 bootstrap testing job
- - - - -
8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00
haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags
Follow up to !12931
- - - - -
210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00
haddock: Remove cabal file linting rule
This will be reintroduced with a properly ignored commit
when the cabal files are themselves formatted for good.
- - - - -
7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00
PPC NCG: Fix sign hints in C calls
Sign hints for parameters are in the second component of the pair.
Fixes #23034
- - - - -
949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00
base: fix missing changelog entries
- - - - -
1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00
GHCi interpreter: Tag constructor closures when possible.
When evaluating PUSH_G try to tag the reference we are pushing if it's a
constructor. This is potentially helpful for performance and required to
fix #24870.
- - - - -
caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00
Implement Data.List.compareLength and Data.List.NonEmpty.compareLength
`compareLength xs n` is a safer and faster alternative to `compare (length xs) n`.
The latter would force and traverse the entire spine (potentially diverging),
while the former traverses as few elements as possible.
The implementation is carefully designed to maintain as much laziness as possible.
As per https://github.com/haskell/core-libraries-committee/issues/257
- - - - -
f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00
Unicode: adding compact version of GeneralCategory (resolves #24789)
The following features are applied:
1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20)
2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20)
-------------------------
Metric Decrease:
size_hello_artifact
size_hello_unicode
-------------------------
- - - - -
0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00
haddock: Restructure import statements
This commit removes idiosyncrasies that have accumulated with the years
in how import statements were laid out, and defines clear but simple
guidelines in the CONTRIBUTING.md file.
- - - - -
9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00
Rename test for #24725
I must have fumbled my tabs when I copy/pasted the issue number in
8c87d4e1136ae6d28e92b8af31d78ed66224ee16.
- - - - -
b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00
Add original reproducer for #24725
- - - - -
77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00
Expand LLVM version matching regex for compability with bsd systems
sed on BSD systems (such as darwin) does not support the + operation.
Therefore we take the simple minded approach of manually expanding
group+ to groupgroup*.
Fixes #24999
- - - - -
bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00
ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain
The version check was previously broken so the toolchain was not
detected at all.
- - - - -
07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00
Update nixpkgs commit for darwin toolchain
One dependency (c-ares) changed where it hosted the releases which
breaks the build with the old nixpkgs commit.
- - - - -
144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00
base: Add changelog entry for #24998
- - - - -
eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00
X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792)
- Without TNTC (tables-next-to-code), we must be careful to not
duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is
identified by the label of its entry block (and not of its info
table), we can't reuse the same label to delimit the block end and the
proc end.
- We generate debug infos from Cmm blocks. However, when
asm-shortcutting is enabled, some blocks are dropped at the asm
codegen stage and some labels in the DebugBlocks become missing.
We fix this by filtering the generated debug-info after the asm
codegen to only keep valid infos.
Also add some related documentation.
- - - - -
6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00
PPC NCG: handle JMP to ForeignLabels (#23969)
- - - - -
9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00
PPC NCG: support loading 64-bit value on 32-bit arch (#23969)
- - - - -
50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00
Fix warnings in genapply
- - - - -
37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00
libraries: Update os-string to 2.0.4
This updates the os-string submodule to 2.0.4 which removes the usage of
`TemplateHaskell` pragma.
- - - - -
870e519b by Vladislav Zavialov at 2024-06-28T19:46:18+04:00
WIP: Types in terms
- - - - -
82ca6313 by Vladislav Zavialov at 2024-06-28T19:46:19+04:00
WIP: -Wview-pattern-signatures
- - - - -
c83c1d2f by Andrei Borzenkov at 2024-06-28T19:46:55+04:00
Implement type syntax in the expressions (24159, 24572, 24226)
- - - - -
30 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/darwin/nix/sources.json
- .gitlab/darwin/toolchain.nix
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Driver/Flags.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/14911adb58e012345d527bbc55aeabce73ef2ab6...c83c1d2f4804694f96a417adc38b003a89da1a45
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/14911adb58e012345d527bbc55aeabce73ef2ab6...c83c1d2f4804694f96a417adc38b003a89da1a45
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/20240628/77315722/attachment-0001.html>
More information about the ghc-commits
mailing list