[flang-commits] [flang] [MLIR][OpenMP] Add Lowering support for implicitly linking to default declare mappers (PR #131006)
Akash Banerjee via flang-commits
flang-commits at lists.llvm.org
Thu Mar 13 07:16:25 PDT 2025
================
@@ -933,18 +933,42 @@ void ClauseProcessor::processMapObjects(
mlir::FlatSymbolRefAttr mapperId;
if (!mapperIdNameRef.empty() && !objects.empty()) {
std::string mapperIdName = mapperIdNameRef.str();
- if (mapperIdName == "default") {
- const omp::Object &object = objects.front();
- auto &typeSpec = object.sym()->owner().IsDerivedType()
- ? *object.sym()->owner().derivedTypeSpec()
- : object.sym()->GetType()->derivedTypeSpec();
- mapperIdName = typeSpec.name().ToString() + ".default";
- mapperIdName = converter.mangleName(mapperIdName, *typeSpec.GetScope());
+ if (mapperIdName == "implicit") {
+ if (!mlir::isa<mlir::omp::DeclareMapperOp>(
+ firOpBuilder.getRegion().getParentOp())) {
+ const omp::Object &object = objects.front();
----------------
TIFitis wrote:
Yes, thanks for catching this. Earlier the explicit use of declare mapper meant we could assume that all the objects would have been of the same derived type. With implicit mapping, this is no longer the case.
I've moved the logic back into the loop to check for each object, and also updated the test case to check for this scenario.
Thanks :)
https://github.com/llvm/llvm-project/pull/131006
More information about the flang-commits
mailing list