[flang-commits] [flang] [flang][cuda] Adding atomicadd as a cudadevice intrinsic and converting it LLVM dialect (PR #123840)
Renaud Kauffmann via flang-commits
flang-commits at lists.llvm.org
Wed Jan 22 15:57:00 PST 2025
================
@@ -2574,6 +2578,26 @@ mlir::Value IntrinsicLibrary::genAtanpi(mlir::Type resultType,
return builder.create<mlir::arith::MulFOp>(loc, atan, factor);
}
+static mlir::Value genAtomBinOp(fir::FirOpBuilder &builder, mlir::Location &loc,
+ mlir::LLVM::AtomicBinOp binOp, mlir::Value arg0,
+ mlir::Value arg1) {
+ auto llvmPointerType = mlir::LLVM::LLVMPointerType::get(builder.getContext());
----------------
Renaud-K wrote:
We always skip through `fir.convert`
```
.Case<fir::ConvertOp>([&](auto op) {
// Skip ConvertOp's and track further through the operand.
v = op->getOperand(0);
defOp = v.getDefiningOp();
})
...
```
I was trying to make sense of the MemoryEffects of `LLVM_AtomicRMWOp` but couldn't quite make sense of it:
```
def LLVM_AtomicRMWOp : LLVM_MemAccessOpBase<"atomicrmw", [
TypesMatchWith<"result #0 and operand #1 have the same type",
"val", "res", "$_self">]> {
```
We talked about these ops in the Lorado office hours today and while we need the hooks in place to create the appropriate instructions we may eventually replace them with higher level atomic operations. TDB.
https://github.com/llvm/llvm-project/pull/123840
More information about the flang-commits
mailing list