[Git][ghc/ghc][wip/T18857] 19 commits: testsuite: Add testcase for #18733
Moritz Angermann
gitlab at gitlab.haskell.org
Mon Nov 16 02:31:25 UTC 2020
Moritz Angermann pushed to branch wip/T18857 at Glasgow Haskell Compiler / GHC
Commits:
787e93ae by Ben Gamari at 2020-11-11T23:14:11-05:00
testsuite: Add testcase for #18733
- - - - -
5353fd50 by Ben Gamari at 2020-11-12T10:05:30-05:00
compiler: Fix recompilation checking
In ticket #18733 we noticed a rather serious deficiency in the current
fingerprinting logic for recursive groups. I have described the old
fingerprinting story and its problems in Note [Fingerprinting recursive
groups] and have reworked the story accordingly to avoid these issues.
Fixes #18733.
- - - - -
63fa3997 by Sebastian Graf at 2020-11-13T14:29:39-05:00
Arity: Rework `ArityType` to fix monotonicity (#18870)
As we found out in #18870, `andArityType` is not monotone, with
potentially severe consequences for termination of fixed-point
iteration. That showed in an abundance of "Exciting arity" DEBUG
messages that are emitted whenever we do more than one step in
fixed-point iteration.
The solution necessitates also recording `OneShotInfo` info for
`ABot` arity type. Thus we get the following definition for `ArityType`:
```
data ArityType = AT [OneShotInfo] Divergence
```
The majority of changes in this patch are the result of refactoring use
sites of `ArityType` to match the new definition.
The regression test `T18870` asserts that we indeed don't emit any DEBUG
output anymore for a function where we previously would have.
Similarly, there's a regression test `T18937` for #18937, which we
expect to be broken for now.
Fixes #18870.
- - - - -
197d59fa by Sebastian Graf at 2020-11-13T14:29:39-05:00
Arity: Emit "Exciting arity" warning only after second iteration (#18937)
See Note [Exciting arity] why we emit the warning at all and why we only
do after the second iteration now.
Fixes #18937.
- - - - -
de7ec9dd by David Eichmann at 2020-11-13T14:30:16-05:00
Add rts_listThreads and rts_listMiscRoots to RtsAPI.h
These are used to find the current roots of the garbage collector.
Co-authored-by: Sven Tennie's avatarSven Tennie <sven.tennie at gmail.com>
Co-authored-by: Matthew Pickering's avatarMatthew Pickering <matthewtpickering at gmail.com>
Co-authored-by: default avatarBen Gamari <bgamari.foss at gmail.com>
- - - - -
24a86f09 by Ben Gamari at 2020-11-13T14:30:51-05:00
gitlab-ci: Cache cabal store in linting job
- - - - -
0a7e592c by Ben Gamari at 2020-11-15T03:35:45-05:00
nativeGen/dwarf: Fix procedure end addresses
Previously the `.debug_aranges` and `.debug_info` (DIE) DWARF
information would claim that procedures (represented with a
`DW_TAG_subprogram` DIE) would only span the range covered by their entry
block. This omitted all of the continuation blocks (represented by
`DW_TAG_lexical_block` DIEs), confusing `perf`. Fix this by introducing
a end-of-procedure label and using this as the `DW_AT_high_pc` of
procedure `DW_TAG_subprogram` DIEs
Fixes #17605.
- - - - -
1e19183d by Ben Gamari at 2020-11-15T03:35:45-05:00
nativeGen/dwarf: Only produce DW_AT_source_note DIEs in -g3
Standard debugging tools don't know how to understand these so let's not
produce them unless asked.
- - - - -
ad73370f by Ben Gamari at 2020-11-15T03:35:45-05:00
nativeGen/dwarf: Use DW_AT_linkage instead of DW_AT_MIPS_linkage
- - - - -
a2539650 by Ben Gamari at 2020-11-15T03:35:45-05:00
gitlab-ci: Add DWARF release jobs for Debian 10, Fedora27
- - - - -
d61adb3d by Ryan Scott at 2020-11-15T03:36:21-05:00
Name (tc)SplitForAll- functions more consistently
There is a zoo of `splitForAll-` functions in `GHC.Core.Type` (as well as
`tcSplitForAll-` functions in `GHC.Tc.Utils.TcType`) that all do very similar
things, but vary in the particular form of type variable that they return. To
make things worse, the names of these functions are often quite misleading.
Some particularly egregious examples:
* `splitForAllTys` returns `TyCoVar`s, but `splitSomeForAllTys` returns
`VarBndr`s.
* `splitSomeForAllTys` returns `VarBndr`s, but `tcSplitSomeForAllTys` returns
`TyVar`s.
* `splitForAllTys` returns `TyCoVar`s, but `splitForAllTysInvis` returns
`InvisTVBinder`s. (This in particular arose in the context of #18939, and
this finally motivated me to bite the bullet and improve the status quo
vis-à-vis how we name these functions.)
In an attempt to bring some sanity to how these functions are named, I have
opted to rename most of these functions en masse to use consistent suffixes
that describe the particular form of type variable that each function returns.
In concrete terms, this amounts to:
* Functions that return a `TyVar` now use the suffix `-TyVar`.
This caused the following functions to be renamed:
* `splitTyVarForAllTys` -> `splitForAllTyVars`
* `splitForAllTy_ty_maybe` -> `splitForAllTyVar_maybe`
* `tcSplitForAllTys` -> `tcSplitForAllTyVars`
* `tcSplitSomeForAllTys` -> `tcSplitSomeForAllTyVars`
* Functions that return a `CoVar` now use the suffix `-CoVar`.
This caused the following functions to be renamed:
* `splitForAllTy_co_maybe` -> `splitForAllCoVar_maybe`
* Functions that return a `TyCoVar` now use the suffix `-TyCoVar`.
This caused the following functions to be renamed:
* `splitForAllTy` -> `splitForAllTyCoVar`
* `splitForAllTys` -> `splitForAllTyCoVars`
* `splitForAllTys'` -> `splitForAllTyCoVars'`
* `splitForAllTy_maybe` -> `splitForAllTyCoVar_maybe`
* Functions that return a `VarBndr` now use the suffix corresponding to the
most relevant type synonym. This caused the following functions to be renamed:
* `splitForAllVarBndrs` -> `splitForAllTyCoVarBinders`
* `splitForAllTysInvis` -> `splitForAllInvisTVBinders`
* `splitForAllTysReq` -> `splitForAllReqTVBinders`
* `splitSomeForAllTys` -> `splitSomeForAllTyCoVarBndrs`
* `tcSplitForAllVarBndrs` -> `tcSplitForAllTyVarBinders`
* `tcSplitForAllTysInvis` -> `tcSplitForAllInvisTVBinders`
* `tcSplitForAllTysReq` -> `tcSplitForAllReqTVBinders`
* `tcSplitForAllTy_maybe` -> `tcSplitForAllTyVarBinder_maybe`
Note that I left the following functions alone:
* Functions that split apart things besides `ForAllTy`s, such as `splitFunTys`
or `splitPiTys`. Thankfully, there are far fewer of these functions than
there are functions that split apart `ForAllTy`s, so there isn't much of a
pressing need to apply the new naming convention elsewhere.
* Functions that split apart `ForAllCo`s in `Coercion`s, such as
`GHC.Core.Coercion.splitForAllCo_maybe`. We could theoretically apply the new
naming convention here, but then we'd have to figure out how to disambiguate
`Type`-splitting functions from `Coercion`-splitting functions. Ultimately,
the `Coercion`-splitting functions aren't used nearly as much as the
`Type`-splitting functions, so I decided to leave the former alone.
This is purely refactoring and should cause no change in behavior.
- - - - -
645444af by Ryan Scott at 2020-11-15T03:36:21-05:00
Use tcSplitForAllInvisTyVars (not tcSplitForAllTyVars) in more places
The use of `tcSplitForAllTyVars` in `tcDataFamInstHeader` was the immediate
cause of #18939, and replacing it with a new `tcSplitForAllInvisTyVars`
function (which behaves like `tcSplitForAllTyVars` but only splits invisible
type variables) fixes the issue. However, this led me to realize that _most_
uses of `tcSplitForAllTyVars` in GHC really ought to be
`tcSplitForAllInvisTyVars` instead. While I was in town, I opted to replace
most uses of `tcSplitForAllTys` with `tcSplitForAllTysInvis` to reduce the
likelihood of such bugs in the future.
I say "most uses" above since there is one notable place where we _do_ want
to use `tcSplitForAllTyVars`: in `GHC.Tc.Validity.forAllTyErr`, which produces
the "`Illegal polymorphic type`" error message if you try to use a higher-rank
`forall` without having `RankNTypes` enabled. Here, we really do want to split
all `forall`s, not just invisible ones, or we run the risk of giving an
inaccurate error message in the newly added `T18939_Fail` test case.
I debated at some length whether I wanted to name the new function
`tcSplitForAllInvisTyVars` or `tcSplitForAllTyVarsInvisible`, but in the end,
I decided that I liked the former better. For consistency's sake, I opted to
rename the existing `splitPiTysInvisible` and `splitPiTysInvisibleN` functions
to `splitInvisPiTys` and `splitPiTysInvisN`, respectively, so that they use the
same naming convention. As a consequence, this ended up requiring a `haddock`
submodule bump.
Fixes #18939.
- - - - -
8887102f by Moritz Angermann at 2020-11-15T03:36:56-05:00
AArch64/arm64 adjustments
This addes the necessary logic to support aarch64 on elf, as well
as aarch64 on mach-o, which Apple calls arm64.
We change architecture name to AArch64, which is the official arm
naming scheme.
- - - - -
fc644b1a by Ben Gamari at 2020-11-15T03:37:31-05:00
ghc-bin: Build with eventlogging by default
We now have all sorts of great facilities using the
eventlog which were previously unavailable without
building a custom GHC. Fix this by linking with
`-eventlog` by default.
- - - - -
af445b07 by Ben Gamari at 2020-11-16T02:28:47+00:00
CmmToLlvm: Declare signature for memcmp
Otherwise `opt` fails with:
error: use of undefined value '@memcmp$def'
Fixes #18857.
- - - - -
660eb5b0 by Ben Gamari at 2020-11-16T02:28:47+00:00
gitlab-ci: Run LLVM job on appropriately-labelled MRs
Namely, those marked with the ~"LLVM backend" label
- - - - -
b4adb002 by Ben Gamari at 2020-11-16T02:31:09+00:00
gitlab-ci: Run LLVM builds on Debian 10
The current Debian 9 image doesn't provide LLVM 7.
- - - - -
5aded170 by Ben Gamari at 2020-11-16T02:31:13+00:00
hadrian: Don't use -fllvm to bootstrap under LLVM flavour
Previously Hadrian's LLVM build flavours would use `-fllvm` for all
invocations, even those to stage0 GHC. This meant that we needed to keep
two LLVM versions around in all of the CI images. Moreover, it differed
from the behavior of the old make build system's llvm flavours.
Change this to reflect the behavior of the `make` build system, using
`-fllvm` only with the stage1 and stage2 compilers.
- - - - -
f7afd6fe by Moritz Angermann at 2020-11-16T02:31:13+00:00
fixup ShortText
- - - - -
30 changed files:
- .gitlab-ci.yml
- aclocal.m4
- compiler/GHC.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/Config.hs
- compiler/GHC/CmmToAsm/Dwarf.hs
- compiler/GHC/CmmToAsm/Dwarf/Constants.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Driver/Session.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3c7f5854d0c5c84de0cf735b511402539a243e72...f7afd6fe76a8d2b365e68557b7c495567a49745c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3c7f5854d0c5c84de0cf735b511402539a243e72...f7afd6fe76a8d2b365e68557b7c495567a49745c
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/20201115/d4723180/attachment-0001.html>
More information about the ghc-commits
mailing list