[clang] [llvm] [LoongArch] Support amcas[_db].{b/h/w/d} instructions. (PR #114189)

WÁNG Xuěruì via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 02:27:47 PDT 2024


================
@@ -363,6 +363,10 @@ LoongArchTargetLowering::LoongArchTargetLowering(const TargetMachine &TM,
   setPrefFunctionAlignment(Subtarget.getPrefFunctionAlignment());
   setPrefLoopAlignment(Subtarget.getPrefLoopAlignment());
   setMaxBytesForAlignment(Subtarget.getMaxBytesForAlignment());
+
+  // Set MinCmpXchg size for 'LAMCAS' feature.
----------------
xen0n wrote:

This is stating the obvious (the reader would know this from the code alone), let's give more background:

```suggestion
  // cmpxchg sizes down to 8 bits become legal if LAMCAS is available.
```

(Or we can actually delete the comment altogether, as this is really obvious even without the explanation. Anyway either is better than re-stating the *what* instead of *why*.)

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


More information about the cfe-commits mailing list