[flang-commits] [flang] [flang][OpenMP] Add implicit casts for omp.atomic.capture (PR #138163)

via flang-commits flang-commits at lists.llvm.org
Sat May 3 00:24:49 PDT 2025


================
@@ -3091,10 +3131,32 @@ static void genAtomicCapture(lower::AbstractConverter &converter,
       firOpBuilder.setInsertionPointToStart(&block);
       const semantics::SomeExpr &fromExpr = *semantics::GetExpr(stmt1Expr);
       mlir::Type elementType = converter.genType(fromExpr);
-      genAtomicCaptureStatement(converter, stmt2LHSArg, stmt1LHSArg,
-                                /*leftHandClauseList=*/nullptr,
-                                /*rightHandClauseList=*/nullptr, elementType,
-                                loc);
+
+      if (stmt1VarType != stmt2VarType) {
----------------
NimishMishra wrote:

Thanks! 

The first two blocks are similar (since the capture-stmt appears first in [capture-stmt, update-stmt] and [capture-stmt, write-stmt]), but the third one is different (for [update-stmt, capture-stmt]). I'll try to refactor

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


More information about the flang-commits mailing list