[llvm] [LoongArch] Record the special AMO operand constraint with TableGen (PR #114398)

WÁNG Xuěruì via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 22:12:38 PST 2024


================
@@ -710,10 +710,22 @@ class STORE_2RI14<bits<32> op>
                "$rd, $rj, $imm14">;
 } // hasSideEffects = 0, mayLoad = 0, mayStore = 1
 
-let hasSideEffects = 0, mayLoad = 1, mayStore = 1, Constraints = "@earlyclobber $rd" in
+let hasSideEffects = 0, mayLoad = 1, mayStore = 1,
+    IsSubjectToAMORdConstraint = 1 in {
 class AM_3R<bits<32> op>
     : Fmt3R<op, (outs GPR:$rd), (ins GPR:$rk, GPRMemAtomic:$rj),
-            "$rd, $rk, $rj">;
+            "$rd, $rk, $rj"> {
+  let Constraints = "@earlyclobber $rd";
+}
+
+class AMCAS_3R<bits<32> op>
+    : Fmt3R<op, (outs GPR:$rd_wb), (ins GPR:$rd, GPR:$rk, GPRMemAtomic:$rj),
+            "$rd, $rk, $rj"> {
+  let Constraints = "$rd = $rd_wb";
----------------
xen0n wrote:

Ah right. I performed a similar change last week but I gave the `@earlyclobber` constraint to `$rd` which errored. I'll fix it now...

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


More information about the llvm-commits mailing list