[Mlir-commits] [flang] [llvm] [mlir] [flang][llvm][OpenMP] Add implicit casts to omp.atomic (PR #131603)

Kiran Chandramohan llvmlistbot at llvm.org
Thu May 1 05:25:51 PDT 2025


================
@@ -2889,9 +2889,55 @@ static void genAtomicRead(lower::AbstractConverter &converter,
       fir::getBase(converter.genExprAddr(fromExpr, stmtCtx));
   mlir::Value toAddress = fir::getBase(converter.genExprAddr(
       *semantics::GetExpr(assignmentStmtVariable), stmtCtx));
-  genAtomicCaptureStatement(converter, fromAddress, toAddress,
-                            leftHandClauseList, rightHandClauseList,
-                            elementType, loc);
+
+  if (fromAddress.getType() != toAddress.getType()) {
----------------
kiranchandramohan wrote:

Please add commenst for:
-> Why we cannot use the typedAssignment lowering and is using custom lowering here? 
-> Why do these casts have to be added?
-> Why is it safe to do so?
-> Why we cannot use the typedAssignment lowering?

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


More information about the Mlir-commits mailing list