[clang] [llvm] [AArch64][clang][llvm] Add ACLE `stshh` atomic store builtin (PR #181386)

Kerry McLaughlin via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 26 03:54:03 PST 2026


================
@@ -1107,6 +1107,124 @@ bool SemaARM::CheckARMBuiltinFunctionCall(const TargetInfo &TI,
   }
 }
 
+static bool CheckAArch64AtomicStoreWithStshhCall(SemaARM &S,
+                                                 CallExpr *TheCall) {
+  Sema &SemaRef = S.SemaRef;
+  ASTContext &Context = S.getASTContext();
+  DeclRefExpr *DRE =
+      cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts());
+  SourceLocation Loc = DRE->getBeginLoc();
+
+  // Ensure we have the proper number of arguments.
+  if (SemaRef.checkArgCount(TheCall, 4))
+    return true;
+
+  // Normalize arg0/arg1 into value form, and check valid
+  ExprResult PtrRes =
+      SemaRef.DefaultFunctionArrayLvalueConversion(TheCall->getArg(0));
+  ExprResult ValRes =
+      SemaRef.DefaultFunctionArrayLvalueConversion(TheCall->getArg(1));
+
+  if (PtrRes.isInvalid())
+    return true;
+
+  if (ValRes.isInvalid())
+    return true;
----------------
kmclaughlin-arm wrote:

nit:
```suggestion
  if (PtrRes.isInvalid() || ValRes.isInvalid())
    return true;
```

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


More information about the cfe-commits mailing list