================
@@ -2314,6 +2317,12 @@ static Value *upgradeNVVMIntrinsicCall(StringRef Name, 
CallBase *CI,
     Value *Val = CI->getArgOperand(1);
     Rep = Builder.CreateAtomicRMW(AtomicRMWInst::FAdd, Ptr, Val, MaybeAlign(),
                                   AtomicOrdering::SequentiallyConsistent);
+  } else if (Name.consume_front("atomic.load.") && Name.consume_back(".32")) {
+    Value *Ptr = CI->getArgOperand(0);
+    Value *Val = CI->getArgOperand(1);
+    auto Op = Name == "inc" ? AtomicRMWInst::UIncWrap : 
AtomicRMWInst::UDecWrap;
+    Rep = Builder.CreateAtomicRMW(Op, Ptr, Val, MaybeAlign(),
+                                  AtomicOrdering::SequentiallyConsistent);
----------------
gonzalobg wrote:

For historical reasons, frontends generate `seq_cst` and "system scope", and we 
(LLVM and NVVM) lower that to `relaxed+gpu scope`. We should definetly 
prioritize fixing these bugs by lowering these properly (there are also a few 
other related bugs that we need to fix).

However, these fixes will break all the frontends, so we need to give some 
thought to how to approach this to minimize churn.

Therefore, i don't know if this PR is the right place to make this fix (this 
has been broken for a long time).

https://github.com/llvm/llvm-project/pull/134111
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to