[flang-commits] [flang] [MLIR][OpenMP] Add Lowering support for implicitly linking to default declare mappers (PR #131006)
Kareem Ergawy via flang-commits
flang-commits at lists.llvm.org
Thu Mar 13 03:00:08 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();
----------------
ergawy wrote:
A newbie question (applies to implicit, default, and explicit mappers). Here we specify the mapper based on the first object. What happens if we have more than one item that have different types? Don't we map the object 2nd and above using a potentially wrong mapper in this case? Or do we have guard against this somehow somewhere else?
https://github.com/llvm/llvm-project/pull/131006
More information about the flang-commits
mailing list