[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 20 commits: cmm: Introduce MO_RelaxedRead

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Dec 28 14:32:14 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
30df7a18 by Ben Gamari at 2023-12-28T09:31:51-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.

- - - - -
a55a2a66 by Ben Gamari at 2023-12-28T09:31:51-05:00
codeGen: Use relaxed accesses in ticky bumping

- - - - -
db9d0d6f by Ben Gamari at 2023-12-28T09:31:51-05:00
base: use atomic write when updating timer manager

- - - - -
84f4df18 by Ben Gamari at 2023-12-28T09:31:51-05:00
Use relaxed atomics to manipulate TSO status fields

- - - - -
12e06987 by Ben Gamari at 2023-12-28T09:31:51-05:00
rts: Add necessary barriers when manipulating TSO owner

- - - - -
4c9d898a by Ben Gamari at 2023-12-28T09:31:51-05:00
rts: Use `switch` to branch on why_blocked

This is a semantics-preserving refactoring.

- - - - -
fe5e3a52 by Ben Gamari at 2023-12-28T09:31:51-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.

- - - - -
151b08e0 by Ben Gamari at 2023-12-28T09:31:51-05:00
rts: Fix data race in threadPaused

This only affects an assertion in the debug RTS and only needs relaxed
ordering.

- - - - -
1242a043 by Ben Gamari at 2023-12-28T09:31:51-05:00
rts: Fix data race in threadStatus#

- - - - -
a8c486cb by Ben Gamari at 2023-12-28T09:31:51-05:00
rts: Fix data race in Interpreter's preemption check

- - - - -
cf3a367e by Ben Gamari at 2023-12-28T09:31:51-05:00
rts/Messages: Fix data race

- - - - -
c808ec9f by Ben Gamari at 2023-12-28T09:31:51-05:00
rts/Prof: Fix data race

- - - - -
5c324d89 by Ben Gamari at 2023-12-28T09:31:51-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.

- - - - -
97e8686b by Ben Gamari at 2023-12-28T09:31:51-05:00
codeGen: Use relaxed-read in closureInfoPtr

- - - - -
7ba6baf1 by Ben Gamari at 2023-12-28T09:31:51-05:00
STM: Use acquire loads when possible

Full sequential consistency is not needed here.

- - - - -
4ca32cbc by Ben Gamari at 2023-12-28T09:31:51-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.

- - - - -
8e18e720 by Ben Gamari at 2023-12-28T09:31:51-05:00
rts: Fix data races in profiling timer

- - - - -
3bb5df3e by Ben Gamari at 2023-12-28T09:31:51-05:00
Add Note [C11 memory model]

- - - - -
c6352355 by Ben Gamari at 2023-12-28T09:31:52-05:00
genSym: Reimplement via CAS on 32-bit platforms

Previously the remaining use of the C implementation on 32-bit platforms
resulted in a subtle bug, #24261. This was due to the C object (which
used the RTS's `atomic_inc64` macro) being compiled without `-threaded`
yet later being used in a threaded compiler.

Side-step this issue by using the pure Haskell `genSym` implementation on
all platforms. This required implementing `fetchAddWord64Addr#` in terms
of CAS on 64-bit platforms.

- - - - -
5f012045 by Xiaoyan Ren at 2023-12-28T09:31:55-05:00
Do not color the diagnostic code in error messages (#24172)

- - - - -


30 changed files:

- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/StgToCmm/Ticky.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Unique/Supply.hs
- compiler/cbits/genSym.c
- compiler/jsbits/genSym.js
- libraries/base/src/GHC/Event/Thread.hs
- rts/Exception.cmm
- rts/HeapStackCheck.cmm
- rts/Interpreter.c
- rts/Messages.c
- rts/PrimOps.cmm
- rts/Proftimer.c
- rts/RaiseAsync.c
- rts/STM.c
- rts/Schedule.c
- rts/StgMiscClosures.cmm
- rts/StgStartup.cmm
- rts/ThreadPaused.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04c8eba9c8625ee7feadab58fc31b79c452dadca...5f012045f637cc49f653456226ae081bdc915aec

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04c8eba9c8625ee7feadab58fc31b79c452dadca...5f012045f637cc49f653456226ae081bdc915aec
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/20231228/fc564bb5/attachment.html>


More information about the ghc-commits mailing list