[llvm-branch-commits] [clang] [llvm] [PowerPC] Add AMO load builtins for conditional increment/decrement (PR #169435)

Maryam Moghadas via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 9 06:50:07 PST 2025


================
@@ -281,6 +285,21 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const TargetInfo &TI,
            << toString(Result, 10) << (IsUnsigned ? "0-4, 6" : "0, 5, 7") << "8"
            << Arg->getSourceRange();
   }
+  case PPC::BI__builtin_amo_lwat_cond:
+  case PPC::BI__builtin_amo_ldat_cond:
+  case PPC::BI__builtin_amo_lwat_cond_s:
+  case PPC::BI__builtin_amo_ldat_cond_s: {
+    llvm::APSInt Result;
+    if (SemaRef.BuiltinConstantArg(TheCall, 1, Result))
+      return true;
+    unsigned Val = Result.getZExtValue();
+    if (llvm::is_contained({24u, 25u, 28u}, Val))
+      return false;
----------------
maryammo wrote:

Different AMO builtins have different valid discrete values for FC, and FC might be a different argument position, so this code would be almost repeated in such a function. But if that makes more sense, I can refactor it.

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


More information about the llvm-branch-commits mailing list