[flang] [llvm] [Flang][OpenMP] Generate correct present checks for implicit maps of optional allocatables (PR #138210)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 8 09:51:59 PDT 2025
================
@@ -156,9 +156,9 @@ genBoundsOpsFromBox(fir::FirOpBuilder &builder, mlir::Location loc,
builder.genIfOp(loc, resTypes, info.isPresent, /*withElseRegion=*/true)
.genThen([&]() {
mlir::Value box =
- !fir::isBoxAddress(info.addr.getType())
+ !fir::isBoxAddress(info.rawInput.getType())
? info.addr
- : builder.create<fir::LoadOp>(loc, info.addr);
+ : builder.create<fir::LoadOp>(loc, info.rawInput);
----------------
agozillon wrote:
Thank you very much for pointing that out Jean! I looked into why it wasn't being triggered and it turns out we need to use the ultimate symbol when we're generating our AddrAndBoundsInfo, as the base symbol we have at that time refers to the map (or in this case shared clause) symbols which don't necessarily have the optional tag/information.
So I've reverted the changes to this bit of code and swapped to utilising the ultimate symbol. Thank you again for helping with the simplification :-)
https://github.com/llvm/llvm-project/pull/138210
More information about the llvm-commits
mailing list