[llvm] [RISCV][ISel] Add codegen support for the experimental zabha extension (PR #80192)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 23:18:04 PST 2024


================
@@ -629,7 +629,10 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
 
   if (Subtarget.hasStdExtA()) {
     setMaxAtomicSizeInBitsSupported(Subtarget.getXLen());
-    setMinCmpXchgSizeInBits(32);
+    if (Subtarget.hasStdExtZabha())
+      setMinCmpXchgSizeInBits(8);
----------------
dtcxzyw wrote:

> That came from [3291f9a](https://github.com/llvm/llvm-project/commit/3291f9aa8168408ce5ef4757012c06c196a72c41), which seems slightly odd. Seems to be assuming shouldExpandAtomicRMWInIR doesn't return None, which it probably should be checking?

@asb @jyknight Any thoughts?


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


More information about the llvm-commits mailing list