[flang-commits] [flang] [llvm] [mlir] [flang][OpenMP] Implement HAS_DEVICE_ADDR clause (PR #128568)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Mar 6 08:52:16 PST 2025


================
@@ -4780,6 +4823,12 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
           moduleTranslation.lookupValue(mapInfoOp.getVarPtr());
       moduleTranslation.mapValue(arg, mapOpValue);
     }
+    for (auto [arg, mapOp] : llvm::zip_equal(hdaBlockArgs, hdaVars)) {
----------------
skatrak wrote:

Nit: Feel free to ignore, but since this loop and the one above have the same body, maybe it makes sense to do instead:
```c++
for (auto [arg, mapOp] : llvm::zip_equal(llvm::concat(mapBlockArgs, hdaBlockArgs), llvm::concat(mapVars, hdaVars))) {
  auto mapInfoOp = cast<omp::MapInfoOp>(mapOp.getDefiningOp());
  llvm::Value *mapOpValue =
      moduleTranslation.lookupValue(mapInfoOp.getVarPtr());
  moduleTranslation.mapValue(arg, mapOpValue);
}
```

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


More information about the flang-commits mailing list