[flang-commits] [flang] [llvm] [mlir] [Flang][OpenMP] Fix Fortran automap handling (PR #162501)
via flang-commits
flang-commits at lists.llvm.org
Wed Jul 8 09:18:22 PDT 2026
================
@@ -6565,7 +6571,7 @@ createAlteredByCaptureMap(MapInfoData &mapData,
std::vector<llvm::Value *> offsetIdx = calculateBoundsOffset(
moduleTranslation, builder, mapData.BaseType[i]->isArrayTy(),
mapOp.getBounds());
- if (isPtrTy)
+ if (isPtrTy && (!isAttachMap || isRefPtrOrPteeMapWithAttach))
----------------
agozillon wrote:
If my assumptions in the comment above are correct (which they might not be, so I would love to see the edge-case we are working with here to understand a bit better) then this might be a little redundant, as an attach map will always come tied with ref_ptr or ref_ptee I think (or both), and in the cases where attach map is not true, we would pass through in any case, so we basically pass through in all cases if I'm thinking about this correctly. I think we might end up with the same interaction as if we just left it isPtrTy, but I would nudge towards not special casing the load here unless absolutely necessary as it could cause the attach maps to become out of synch with the regular base pointer/descriptor maps or have weird bound offsets applied, but it's unlikely I think, regardless might be worth checking if you absolutely need this casing still :-)
https://github.com/llvm/llvm-project/pull/162501
More information about the flang-commits
mailing list