[clang] [llvm] [AArch64] Implement the atomic store with hint intrinsic (PR #198316)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 05:23:56 PDT 2026


================
@@ -0,0 +1,36 @@
+//===-- AArch64AtomicHints.h - AArch64 Atomic Hint Attributes ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_AARCH64ATOMICHINTS_H
+#define LLVM_SUPPORT_AARCH64ATOMICHINTS_H
+
+namespace llvm {
+enum class AArch64AtomicStoreHint {
+  HINT_NONE = 0,
+  HINT_STSHH_KEEP = 1,
+  HINT_STSHH_STRM = 2,
+};
+
+template <typename Int> inline bool isValidAArch64AtomicHintValue(Int I) {
+  return (Int)AArch64AtomicStoreHint::HINT_STSHH_KEEP <= I &&
+         I <= (Int)AArch64AtomicStoreHint::HINT_STSHH_STRM;
+}
+
+template <typename Int>
+inline AArch64AtomicStoreHint getAtomicStoreHintFromMD(Int I) {
----------------
Lukacma wrote:

Maybe it would be better to just keep it as getAtomicStoreHint or maybe renaming it to `toAArch64Hint` to follow naming in AtomicOrdering.h.

https://github.com/llvm/llvm-project/pull/198316


More information about the cfe-commits mailing list