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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 18:31:29 PST 2024


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

I see now why you had to change this since it's used to by the AtomicExpand pass to know if masking is needed. But changing it produces incorrect code for 8 and 16 bit Nand and cmpxchg where we still need masking.

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


More information about the llvm-commits mailing list