[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 19 09:30:52 PDT 2024


================
@@ -871,7 +871,8 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
   // actions
   computeRegisterProperties(STI.getRegisterInfo());
 
-  setMinCmpXchgSizeInBits(32);
+  bool Allow16BitCAS = STI.getSmVersion() >= 70 && STI.getPTXVersion() >= 63;
+  setMinCmpXchgSizeInBits(Allow16BitCAS ? 16 : 32);
----------------
gonzalobg wrote:

Thank you, looks great!

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


More information about the cfe-commits mailing list