[Git][ghc/ghc][wip/bump-images-9.6] 43 commits: cmm: Introduce MO_RelaxedRead
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Wed Feb 7 10:22:15 UTC 2024
Matthew Pickering pushed to branch wip/bump-images-9.6 at Glasgow Haskell Compiler / GHC
Commits:
31553b11 by Ben Gamari at 2024-02-01T12:21:29-05:00
cmm: Introduce MO_RelaxedRead
In hand-written Cmm it can sometimes be necessary to atomically load
from memory deep within an expression (e.g. see the `CHECK_GC` macro).
This MachOp provides a convenient way to do so without breaking the
expression into multiple statements.
- - - - -
0785cf81 by Ben Gamari at 2024-02-01T12:21:29-05:00
codeGen: Use relaxed accesses in ticky bumping
- - - - -
be423dda by Ben Gamari at 2024-02-01T12:21:29-05:00
base: use atomic write when updating timer manager
- - - - -
8a310e35 by Ben Gamari at 2024-02-01T12:21:29-05:00
Use relaxed atomics to manipulate TSO status fields
- - - - -
d6809ee4 by Ben Gamari at 2024-02-01T12:21:29-05:00
rts: Add necessary barriers when manipulating TSO owner
- - - - -
39e3ac5d by Ben Gamari at 2024-02-01T12:21:29-05:00
rts: Use `switch` to branch on why_blocked
This is a semantics-preserving refactoring.
- - - - -
515eb33d by Ben Gamari at 2024-02-01T12:21:29-05:00
rts: Fix synchronization on thread blocking state
We now use a release barrier whenever we update a thread's blocking
state. This required widening StgTSO.why_blocked as AArch64 does not
support atomic writes on 16-bit values.
- - - - -
eb38812e by Ben Gamari at 2024-02-01T12:21:29-05:00
rts: Fix data race in threadPaused
This only affects an assertion in the debug RTS and only needs relaxed
ordering.
- - - - -
26c48dd6 by Ben Gamari at 2024-02-01T12:21:29-05:00
rts: Fix data race in threadStatus#
- - - - -
6af43ab4 by Ben Gamari at 2024-02-01T12:21:29-05:00
rts: Fix data race in Interpreter's preemption check
- - - - -
9502ad3c by Ben Gamari at 2024-02-01T12:21:29-05:00
rts/Messages: Fix data race
- - - - -
60802db5 by Ben Gamari at 2024-02-01T12:21:30-05:00
rts/Prof: Fix data race
- - - - -
ef8ccef5 by Ben Gamari at 2024-02-01T12:21:30-05:00
rts: Use relaxed ordering on dirty/clean info tables updates
When changing the dirty/clean state of a mutable object we needn't have
any particular ordering.
- - - - -
76fe2b75 by Ben Gamari at 2024-02-01T12:21:30-05:00
codeGen: Use relaxed-read in closureInfoPtr
- - - - -
a6316eb4 by Ben Gamari at 2024-02-01T12:21:30-05:00
STM: Use acquire loads when possible
Full sequential consistency is not needed here.
- - - - -
6bddfd3d by Ben Gamari at 2024-02-01T12:21:30-05:00
rts: Use fence rather than redundant load
Previously we would use an atomic load to ensure acquire ordering.
However, we now have `ACQUIRE_FENCE_ON`, which allows us to express this
more directly.
- - - - -
55c65dbc by Ben Gamari at 2024-02-01T12:21:30-05:00
rts: Fix data races in profiling timer
- - - - -
856b5e75 by Ben Gamari at 2024-02-01T12:21:30-05:00
Add Note [C11 memory model]
- - - - -
6534da24 by Cheng Shao at 2024-02-01T12:22:07-05:00
compiler: move generic cmm optimization logic in NCG to a standalone module
This commit moves GHC.CmmToAsm.cmmToCmm to a standalone module,
GHC.Cmm.GenericOpt. The main motivation is enabling this logic to be
run in the wasm backend NCG code, which is defined in other modules
that's imported by GHC.CmmToAsm, causing a cyclic dependency issue.
- - - - -
87e34888 by Cheng Shao at 2024-02-01T12:22:07-05:00
compiler: explicitly disable PIC in wasm32 NCG
This commit explicitly disables the ncgPIC flag for the wasm32 target.
The wasm backend doesn't support PIC for the time being.
- - - - -
c6ce242e by Cheng Shao at 2024-02-01T12:22:07-05:00
compiler: enable generic cmm optimizations in wasm backend NCG
This commit enables the generic cmm optimizations in other NCGs to be
run in the wasm backend as well, followed by a late cmm control-flow
optimization pass. The added optimizations do catch some corner cases
not handled by the pre-NCG cmm pipeline and are useful in generating
smaller CFGs.
- - - - -
151dda4e by Andrei Borzenkov at 2024-02-01T12:22:43-05:00
Namespacing for WARNING/DEPRECATED pragmas (#24396)
New syntax for WARNING and DEPRECATED pragmas was added,
namely namespace specifierss:
namespace_spec ::= 'type' | 'data' | {- empty -}
warning ::= warning_category namespace_spec namelist strings
deprecation ::= namespace_spec namelist strings
A new data type was introduced to represent these namespace specifiers:
data NamespaceSpecifier =
NoSpecifier |
TypeNamespaceSpecifier (EpToken "type") |
DataNamespaceSpecifier (EpToken "data")
Extension field XWarning now contains this NamespaceSpecifier.
lookupBindGroupOcc function was changed: it now takes NamespaceSpecifier
and checks that the namespace of the found names matches the passed flag.
With this change {-# WARNING data D "..." #-} pragma will only affect value
namespace and {-# WARNING type D "..." #-} will only affect type
namespace. The same logic is applicable to DEPRECATED pragmas.
Finding duplicated warnings inside rnSrcWarnDecls now takes into
consideration NamespaceSpecifier flag to allow warnings with the
same names that refer to different namespaces.
- - - - -
38c3afb6 by Bryan Richter at 2024-02-01T12:23:19-05:00
CI: Disable the test-cabal-reinstall job
Fixes #24363
- - - - -
27020458 by Matthew Craven at 2024-02-03T01:53:26-05:00
Bump bytestring submodule to something closer to 0.12.1
...mostly so that 16d6b7e835ffdcf9b894e79f933dd52348dedd0c
(which reworks unaligned writes in Builder) and the stuff in
https://github.com/haskell/bytestring/pull/631 can see wider testing.
The less-terrible code for unaligned writes used in Builder on
hosts not known to be ulaigned-friendly also takes less effort
for GHC to compile, resulting in a metric decrease for T21839c
on some platforms.
The metric increase on T21839r is caused by the unrelated commit
750dac33465e7b59100698a330b44de7049a345c. It perhaps warrants
further analysis and discussion (see #23822) but is not critical.
Metric Decrease:
T21839c
Metric Increase:
T21839r
- - - - -
cdddeb0f by Rodrigo Mesquita at 2024-02-03T01:54:02-05:00
Work around autotools setting C11 standard in CC/CXX
In autoconf >=2.70, C11 is set by default for $CC and $CXX via the
-std=...11 flag. In this patch, we split the "-std" flag out of the $CC
and $CXX variables, which we traditionally assume to be just the
executable name/path, and move it to $CFLAGS/$CXXFLAGS instead.
Fixes #24324
- - - - -
5ff7cc26 by Apoorv Ingle at 2024-02-03T13:14:46-06:00
Expand `do` blocks right before typechecking using the `HsExpansion` philosophy.
- Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206
- The change is detailed in
- Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do`
- Note [Doing HsExpansion in the Renamer vs Typechecker] in `GHC.Rename.Expr`
expains the rational of doing expansions in type checker as opposed to in the renamer
- Adds new datatypes:
- `GHC.Hs.Expr.XXExprGhcRn`: new datatype makes this expansion work easier
1. Expansion bits for Expressions, Statements and Patterns in (`ExpandedThingRn`)
2. `PopErrCtxt` a special GhcRn Phase only artifcat to pop the previous error message in the error context stack
- `GHC.Basic.Origin` now tracks the reason for expansion in case of Generated
This is useful for type checking cf. `GHC.Tc.Gen.Expr.tcExpr` case for `HsLam`
- Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc`
- Ensures warnings such as
1. Pattern match checks
2. Failable patterns
3. non-() return in body statements are preserved
- Kill `HsMatchCtxt` in favor of `TcMatchAltChecker`
- Testcases:
* T18324 T20020 T23147 T22788 T15598 T22086
* T23147b (error message check),
* DoubleMatch (match inside a match for pmc check)
* pattern-fails (check pattern match with non-refutable pattern, eg. newtype)
* Simple-rec (rec statements inside do statment)
* T22788 (code snippet from #22788)
* DoExpanion1 (Error messages for body statments)
* DoExpansion2 (Error messages for bind statements)
* DoExpansion3 (Error messages for let statements)
Also repoint haddock to the right submodule so that the test (haddockHypsrcTest) pass
Metric Increase 'compile_time/bytes allocated':
T9020
The testcase is a pathalogical example of a `do`-block with many statements that do nothing.
Given that we are expanding the statements into function binds, we will have to bear
a (small) 2% cost upfront in the compiler to unroll the statements.
- - - - -
0df8ce27 by Vladislav Zavialov at 2024-02-04T03:55:14-05:00
Reduce parser allocations in allocateCommentsP
In the most common case, the comment queue is empty, so we can skip the
work of processing it. This reduces allocations by about 10% in the
parsing001 test.
Metric Decrease:
MultiLayerModulesRecomp
parsing001
- - - - -
cfd68290 by Simon Peyton Jones at 2024-02-05T17:58:33-05:00
Stop dropping a case whose binder is demanded
This MR fixes #24251.
See Note [Case-to-let for strictly-used binders]
in GHC.Core.Opt.Simplify.Iteration, plus #24251, for
lots of discussion.
Final Nofib changes over 0.1%:
+-----------------------------------------
| imaginary/digits-of-e2 -2.16%
| imaginary/rfib -0.15%
| real/fluid -0.10%
| real/gamteb -1.47%
| real/gg -0.20%
| real/maillist +0.19%
| real/pic -0.23%
| real/scs -0.43%
| shootout/n-body -0.41%
| shootout/spectral-norm -0.12%
+========================================
| geom mean -0.05%
Pleasingly, overall executable size is down by just over 1%.
Compile times (in perf/compiler) wobble around a bit +/- 0.5%, but the
geometric mean is -0.1% which seems good.
- - - - -
e4d137bb by Simon Peyton Jones at 2024-02-05T17:58:33-05:00
Add Note [Bangs in Integer functions]
...to document the bangs in the functions in GHC.Num.Integer
- - - - -
ce90f12f by Andrei Borzenkov at 2024-02-05T17:59:09-05:00
Hide WARNING/DEPRECATED namespacing under -XExplicitNamespaces (#24396)
- - - - -
e2ea933f by Simon Peyton Jones at 2024-02-06T10:12:04-05:00
Refactoring in preparation for lazy skolemisation
* Make HsMatchContext and HsStmtContext be parameterised over the
function name itself, rather than over the pass.
See [mc_fun field of FunRhs] in Language.Haskell.Syntax.Expr
- Replace types
HsMatchContext GhcPs --> HsMatchContextPs
HsMatchContext GhcRn --> HsMatchContextRn
HsMatchContext GhcTc --> HsMatchContextRn (sic! not Tc)
HsStmtContext GhcRn --> HsStmtContextRn
- Kill off convertHsMatchCtxt
* Split GHC.Tc.Type.BasicTypes.TcSigInfo so that TcCompleteSig (describing
a complete user-supplied signature) is its own data type.
- Split TcIdSigInfo(CompleteSig, PartialSig) into
TcCompleteSig(CSig)
TcPartialSig(PSig)
- Use TcCompleteSig in tcPolyCheck, CheckGen
- Rename types and data constructors:
TcIdSigInfo --> TcIdSig
TcPatSynInfo(TPSI) --> TcPatSynSig(PatSig)
- Shuffle around helper functions:
tcSigInfoName (moved to GHC.Tc.Types.BasicTypes)
completeSigPolyId_maybe (moved to GHC.Tc.Types.BasicTypes)
tcIdSigName (inlined and removed)
tcIdSigLoc (introduced)
- Rearrange the pattern match in chooseInferredQuantifiers
* Rename functions and types:
tcMatchesCase --> tcCaseMatches
tcMatchesFun --> tcFunBindMatches
tcMatchLambda --> tcLambdaMatches
tcPats --> tcMatchPats
matchActualFunTysRho --> matchActualFunTys
matchActualFunTySigma --> matchActualFunTy
* Add HasDebugCallStack constraints to:
mkBigCoreVarTupTy, mkBigCoreTupTy, boxTy,
mkPiTy, mkPiTys, splitAppTys, splitTyConAppNoView_maybe
* Use `penv` from the outer context in the inner loop of
GHC.Tc.Gen.Pat.tcMultiple
* Move tcMkVisFunTy, tcMkInvisFunTy, tcMkScaledFunTys down the file,
factor out and export tcMkScaledFunTy.
* Move isPatSigCtxt down the file.
* Formatting and comments
Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com>
- - - - -
f5d3e03c by Andrei Borzenkov at 2024-02-06T10:12:04-05:00
Lazy skolemisation for @a-binders (#17594)
This patch is a preparation for @a-binders implementation. The main changes are:
* Skolemisation is now prepared to deal with @binders.
See Note [Skolemisation overview] in GHC.Tc.Utils.Unify.
Most of the action is in
- Utils.Unify.matchExpectedFunTys
- Gen.Pat.tcMatchPats
- Gen.Expr.tcPolyExprCheck
- Gen.Binds.tcPolyCheck
Some accompanying refactoring:
* I found that funTyConAppTy_maybe was doing a lot of allocation, and
rejigged userTypeError_maybe to avoid calling it.
- - - - -
532993c8 by Zubin Duggal at 2024-02-06T10:12:41-05:00
driver: Really don't lose track of nodes when we fail to resolve cycles
This fixes a bug in 8db8d2fd1c881032b1b360c032b6d9d072c11723, where we could lose
track of acyclic components at the start of an unresolved cycle. We now ensure we
never loose track of any of these components.
As T24275 demonstrates, a "cyclic" SCC might not really be a true SCC:
When viewed without boot files, we have a single SCC
```
[REC main:T24275B [main:T24275B {-# SOURCE #-},
main:T24275A {-# SOURCE #-}]
main:T24275A [main:T24275A {-# SOURCE #-}]]
```
But with boot files this turns into
```
[NONREC main:T24275B {-# SOURCE #-} [],
REC main:T24275B [main:T24275B {-# SOURCE #-},
main:T24275A {-# SOURCE #-}]
main:T24275A {-# SOURCE #-} [main:T24275B],
NONREC main:T24275A [main:T24275A {-# SOURCE #-}]]
```
Note that this is truly not an SCC, as no nodes are reachable from T24275B.hs-boot.
However, we treat this entire group as a single "SCC" because it seems so when we
analyse the graph without taking boot files into account.
Indeed, we must return a single ResolvedCycle element in the BuildPlan for this
as described in Note [Upsweep].
However, since after resolving this is not a true SCC anymore, `findCycle` fails
to find a cycle and we have a sub-optimal error message as a result.
To handle this, I extended `findCycle` to not assume its input is an SCC, and to
try harder to find cycles in its input.
Fixes #24275
- - - - -
b35dd613 by Zubin Duggal at 2024-02-06T10:13:17-05:00
GHCi: Lookup breakpoint CCs in the correct module
We need to look up breakpoint CCs in the module that the breakpoint
points to, and not the current module.
Fixes #24327
- - - - -
b09e6958 by Zubin Duggal at 2024-02-06T10:13:17-05:00
testsuite: Add test for #24327
- - - - -
569b4c10 by doyougnu at 2024-02-07T03:06:26-05:00
ts: add compile_artifact, ignore_extension flag
In b521354216f2821e00d75f088d74081d8b236810 the testsuite gained the
capability to collect generic metrics. But this assumed that the test
was not linking and producing artifacts and we only wanted to track
object files, interface files, or build artifacts from the compiler
build. However, some backends, such as the JS backend, produce artifacts when
compiling, such as the jsexe directory which we want to track.
This patch:
- tweaks the testsuite to collect generic metrics on any build artifact
in the test directory.
- expands the exe_extension function to consider windows and adds the
ignore_extension flag.
- Modifies certain tests to add the ignore_extension flag. Tests such as
heaprof002 expect a .ps file, but on windows without ignore_extensions
the testsuite will look for foo.exe.ps. Hence the flag.
- adds the size_hello_artifact test
- - - - -
75a31379 by doyougnu at 2024-02-07T03:06:26-05:00
ts: add wasm_arch, heapprof002 wasm extension
- - - - -
c9731d6d by Rodrigo Mesquita at 2024-02-07T03:07:03-05:00
Synchronize bindist configure for #24324
In cdddeb0f1280b40cc194028bbaef36e127175c4c, we set up a
workaround for #24324 in the in-tree configure script, but forgot to
update the bindist configure script accordingly. This updates it.
- - - - -
d309f4e7 by Matthew Pickering at 2024-02-07T03:07:38-05:00
distrib/configure: Fix typo in CONF_GCC_LINKER_OPTS_STAGE2 variable
Instead we were setting CONF_GCC_LINK_OPTS_STAGE2 which meant that we
were missing passing `--target` when invoking the linker.
Fixes #24414
- - - - -
90737ca9 by Matthew Pickering at 2024-02-07T10:19:19+00:00
Use specific clang assembler when compiling with -fllvm
There are situations where LLVM will produce assembly which older gcc
toolchains can't handle. For example on Deb10, it seems that LLVM >= 13
produces assembly which the default gcc doesn't support.
A more robust solution in the long term is to require a specific LLVM
compatible assembler when using -fllvm.
Fixes #16354
- - - - -
27f3c8b1 by Matthew Pickering at 2024-02-07T10:19:19+00:00
Update CI images with LLVM 15, ghc-9.6.4 and cabal-install-3.10.2.0
- - - - -
f0849231 by Matthew Pickering at 2024-02-07T10:19:19+00:00
Update bootstrap plans for 9.4.8 and 9.6.4
- - - - -
492c022f by Matthew Pickering at 2024-02-07T10:19:19+00:00
Add alpine 3_18 release job
This is mainly experimental and future proofing to enable a smooth
transition to newer alpine releases once 3_12 is too old.
- - - - -
30 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- compiler/GHC/Cmm/Expr.hs
- + compiler/GHC/Cmm/GenericOpt.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/Graph/Directed.hs
- compiler/GHC/Driver/Config/CmmToAsm.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.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/24faed169859523cd6bad1241e45e5da5a3b4ab9...492c022fbb8032a4753f16bbe19308c69dcd4eae
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/24faed169859523cd6bad1241e45e5da5a3b4ab9...492c022fbb8032a4753f16bbe19308c69dcd4eae
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/20240207/916bdf1d/attachment-0001.html>
More information about the ghc-commits
mailing list