[clang] [llvm] [RISCV][LLVM] Enable atomics for 'Zalrsc' (PR #163672)

Francesco Petrogalli via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 16 11:53:01 PDT 2025


================
@@ -225,7 +225,7 @@ class LLVM_LIBRARY_VISIBILITY RISCV64TargetInfo : public RISCVTargetInfo {
   void setMaxAtomicWidth() override {
     MaxAtomicPromoteWidth = 128;
 
-    if (ISAInfo->hasExtension("a"))
+    if (ISAInfo->hasExtension("a") || ISAInfo->hasExtension("zalrsc"))
----------------
fpetrogalli wrote:

I'd prefer the frontend to adhere to the actual ISA split in the specs, and remove the "a" check.

How about just adding two lines of comment explaining why zalrsc and not "a" is checked here? Might be a bit redundant (the commit message will explain the change), but very effective for readability and grep-ability.

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


More information about the cfe-commits mailing list