[clang] [llvm] [AArch64] Implement the atomic store with hint intrinsic (PR #198316)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 22 09:18:40 PDT 2026
================
@@ -18521,7 +18522,25 @@ AArch64TargetLowering::getTargetMMOFlags(const Instruction &I) const {
if (Subtarget->getProcFamily() == AArch64Subtarget::Falkor &&
I.hasMetadata(FALKOR_STRIDED_ACCESS_MD))
return MOStridedAccess;
- return MachineMemOperand::MONone;
+
+ auto Flags = MachineMemOperand::MONone;
+ const MDNode *AtomicStHint = I.getMetadata(AARCH64_ATOMIC_STORE_HINT_MD);
+ if (AtomicStHint) {
+ unsigned HintVal =
+ cast<ConstantInt>(
+ cast<ConstantAsMetadata>(AtomicStHint->getOperand(0))->getValue())
+ ->getZExtValue();
+ AArch64AtomicStoreHint Hint = getAtomicStoreHintFromMD(HintVal);
+ assert(Hint != AArch64AtomicStoreHint::HINT_NONE &&
+ "Unrecognised atomic hint value requested.");
----------------
Lukacma wrote:
Ah I see the difference now ! Though I am not sure these assertion should exist. As mentioned we should just ignore invalid hint and treat it is as no hint store.
https://github.com/llvm/llvm-project/pull/198316
More information about the cfe-commits
mailing list