[Git][ghc/ghc][master] 2 commits: llvmGen: Fix relaxed ordering

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Dec 24 05:42:38 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
63b97430 by Ben Gamari at 2022-12-24T00:42:16-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
- - - - -
f42ba88f by Ben Gamari at 2022-12-24T00:42:16-05:00
gitlab-ci: Introduce aarch64-linux-llvm job

This nightly job will ensure that we don't break the LLVM backend on
AArch64/Linux by bootstrapping GHC.

This would have caught #22640.

- - - - -


3 changed files:

- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToLlvm/CodeGen.hs


Changes:

=====================================
.gitlab/gen_ci.hs
=====================================
@@ -807,6 +807,7 @@ jobs = Map.fromList $ concatMap flattenJobGroup $
      , allowFailureGroup (addValidateRule FreeBSDLabel (standardBuilds Amd64 FreeBSD13))
      , standardBuilds AArch64 Darwin
      , standardBuilds AArch64 (Linux Debian10)
+     , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) llvm)
      , standardBuilds I386 (Linux Debian9)
      , standardBuildsWithConfig Amd64 (Linux Alpine) static
      , disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) staticNativeInt))


=====================================
.gitlab/jobs.yaml
=====================================
@@ -120,6 +120,64 @@
       "TEST_ENV": "aarch64-linux-deb10-validate"
     }
   },
+  "aarch64-linux-deb10-validate+llvm": {
+    "after_script": [
+      ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh clean",
+      "cat ci_timings"
+    ],
+    "allow_failure": false,
+    "artifacts": {
+      "expire_in": "2 weeks",
+      "paths": [
+        "ghc-aarch64-linux-deb10-validate+llvm.tar.xz",
+        "junit.xml"
+      ],
+      "reports": {
+        "junit": "junit.xml"
+      },
+      "when": "always"
+    },
+    "cache": {
+      "key": "aarch64-linux-deb10-$CACHE_REV",
+      "paths": [
+        "cabal-cache",
+        "toolchain"
+      ]
+    },
+    "dependencies": [],
+    "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV",
+    "needs": [
+      {
+        "artifacts": false,
+        "job": "hadrian-ghc-in-ghci"
+      }
+    ],
+    "rules": [
+      {
+        "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"disabled\" != \"disabled\")",
+        "when": "on_success"
+      }
+    ],
+    "script": [
+      "sudo chown ghc:ghc -R .",
+      ".gitlab/ci.sh setup",
+      ".gitlab/ci.sh configure",
+      ".gitlab/ci.sh build_hadrian",
+      ".gitlab/ci.sh test_hadrian"
+    ],
+    "stage": "full-build",
+    "tags": [
+      "aarch64-linux"
+    ],
+    "variables": {
+      "BIGNUM_BACKEND": "gmp",
+      "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate+llvm",
+      "BUILD_FLAVOUR": "validate+llvm",
+      "CONFIGURE_ARGS": "",
+      "TEST_ENV": "aarch64-linux-deb10-validate+llvm"
+    }
+  },
   "i386-linux-deb9-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
@@ -300,6 +358,65 @@
       "XZ_OPT": "-9"
     }
   },
+  "nightly-aarch64-linux-deb10-validate+llvm": {
+    "after_script": [
+      ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh clean",
+      "cat ci_timings"
+    ],
+    "allow_failure": false,
+    "artifacts": {
+      "expire_in": "8 weeks",
+      "paths": [
+        "ghc-aarch64-linux-deb10-validate+llvm.tar.xz",
+        "junit.xml"
+      ],
+      "reports": {
+        "junit": "junit.xml"
+      },
+      "when": "always"
+    },
+    "cache": {
+      "key": "aarch64-linux-deb10-$CACHE_REV",
+      "paths": [
+        "cabal-cache",
+        "toolchain"
+      ]
+    },
+    "dependencies": [],
+    "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV",
+    "needs": [
+      {
+        "artifacts": false,
+        "job": "hadrian-ghc-in-ghci"
+      }
+    ],
+    "rules": [
+      {
+        "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")",
+        "when": "on_success"
+      }
+    ],
+    "script": [
+      "sudo chown ghc:ghc -R .",
+      ".gitlab/ci.sh setup",
+      ".gitlab/ci.sh configure",
+      ".gitlab/ci.sh build_hadrian",
+      ".gitlab/ci.sh test_hadrian"
+    ],
+    "stage": "full-build",
+    "tags": [
+      "aarch64-linux"
+    ],
+    "variables": {
+      "BIGNUM_BACKEND": "gmp",
+      "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate+llvm",
+      "BUILD_FLAVOUR": "validate+llvm",
+      "CONFIGURE_ARGS": "",
+      "TEST_ENV": "aarch64-linux-deb10-validate+llvm",
+      "XZ_OPT": "-9"
+    }
+  },
   "nightly-i386-linux-deb9-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
@@ -1869,6 +1986,66 @@
       "XZ_OPT": "-9"
     }
   },
+  "release-aarch64-linux-deb10-release+llvm": {
+    "after_script": [
+      ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh clean",
+      "cat ci_timings"
+    ],
+    "allow_failure": false,
+    "artifacts": {
+      "expire_in": "1 year",
+      "paths": [
+        "ghc-aarch64-linux-deb10-release+llvm.tar.xz",
+        "junit.xml"
+      ],
+      "reports": {
+        "junit": "junit.xml"
+      },
+      "when": "always"
+    },
+    "cache": {
+      "key": "aarch64-linux-deb10-$CACHE_REV",
+      "paths": [
+        "cabal-cache",
+        "toolchain"
+      ]
+    },
+    "dependencies": [],
+    "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV",
+    "needs": [
+      {
+        "artifacts": false,
+        "job": "hadrian-ghc-in-ghci"
+      }
+    ],
+    "rules": [
+      {
+        "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")",
+        "when": "on_success"
+      }
+    ],
+    "script": [
+      "sudo chown ghc:ghc -R .",
+      ".gitlab/ci.sh setup",
+      ".gitlab/ci.sh configure",
+      ".gitlab/ci.sh build_hadrian",
+      ".gitlab/ci.sh test_hadrian"
+    ],
+    "stage": "full-build",
+    "tags": [
+      "aarch64-linux"
+    ],
+    "variables": {
+      "BIGNUM_BACKEND": "gmp",
+      "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-release+llvm",
+      "BUILD_FLAVOUR": "release+llvm",
+      "CONFIGURE_ARGS": "",
+      "IGNORE_PERF_FAILURES": "all",
+      "TEST_ENV": "aarch64-linux-deb10-release+llvm",
+      "XZ_OPT": "-9"
+    }
+  },
   "release-i386-linux-deb9-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",


=====================================
compiler/GHC/CmmToLlvm/CodeGen.hs
=====================================
@@ -2030,7 +2030,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/-/compare/c264b06b4e77976939386a6d373d00118562c376...f42ba88fd32f1def7dcf02f0a2227b453bf5971c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c264b06b4e77976939386a6d373d00118562c376...f42ba88fd32f1def7dcf02f0a2227b453bf5971c
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/20221224/84b766ba/attachment-0001.html>


More information about the ghc-commits mailing list