[Git][ghc/ghc][ghc-9.4] llvmGen: Fix relaxed ordering

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Dec 21 20:13:25 UTC 2022



Ben Gamari pushed to branch ghc-9.4 at Glasgow Haskell Compiler / GHC


Commits:
87e87896 by Ben Gamari at 2022-12-21T15:13:05-05:00
llvmGen: Fix relaxed ordering

Previously I used LLVM's `unordered` ordering for the C11 `relaxed`
ordering. However, this is wrong and should rather use the LLVM
`monotonic` ordering.

Fixes #22640
- - - - -


1 changed file:

- compiler/GHC/CmmToLlvm/CodeGen.hs


Changes:

=====================================
compiler/GHC/CmmToLlvm/CodeGen.hs
=====================================
@@ -2041,7 +2041,7 @@ genLit _ CmmHighStackMark
 --
 
 convertMemoryOrdering :: MemoryOrdering -> LlvmSyncOrdering
-convertMemoryOrdering MemOrderRelaxed = SyncUnord
+convertMemoryOrdering MemOrderRelaxed = SyncMonotonic
 convertMemoryOrdering MemOrderAcquire = SyncAcquire
 convertMemoryOrdering MemOrderRelease = SyncRelease
 convertMemoryOrdering MemOrderSeqCst  = SyncSeqCst



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/87e87896bd640c39afeeb76189f989a8374f0e37

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/87e87896bd640c39afeeb76189f989a8374f0e37
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/20221221/cbf312fb/attachment.html>


More information about the ghc-commits mailing list