[Mlir-commits] [flang] [mlir] [flang][OpenMP] Add `hostIsSource` paramemter to `copyHostAssociateVar` (PR #123162)

Leandro Lupori llvmlistbot at llvm.org
Thu Jan 16 05:12:23 PST 2025


================
@@ -927,10 +927,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
 
     copyVar(sym, *lhs_sb, *rhs_sb, sym.flags());
 
-    if (copyAssignIP && copyAssignIP->isSet() &&
-        sym.test(Fortran::semantics::Symbol::Flag::OmpLastPrivate)) {
+    if (!hostIsSource)
       builder->restoreInsertionPoint(insPt);
----------------
luporl wrote:

This part is a bit confusing. Why do we restore the insertion point when `hostIsSource` is set?

Using `if (copyAssignIP && copyAssignIP->isSet())` would be clearer, since the same condition is used to modify the insertion point above. Does anything breaks if this is changed?

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


More information about the Mlir-commits mailing list