Skip to content

Commit 062409a

Browse files
committed
Handle mappers
1 parent 0589a3e commit 062409a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,9 +3300,20 @@ static void collectMapDataFromMapOperands(
33003300
// rematerialized, so the address of the decriptor for a given object
33013301
// may change from one place to another.
33023302
mapData.Types.push_back(mapType);
3303+
// Technically it's possible for a non-descriptor mapping to have
3304+
// both has-device-addr and ALWAYS, so lookup the mapper in case it
3305+
// exists.
3306+
if (mapOp.getMapperId()) {
3307+
mapData.Mappers.push_back(
3308+
SymbolTable::lookupNearestSymbolFrom<omp::DeclareMapperOp>(
3309+
mapOp, mapOp.getMapperIdAttr()));
3310+
} else {
3311+
mapData.Mappers.push_back(nullptr);
3312+
}
33033313
} else {
33043314
mapData.Types.push_back(
33053315
llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_LITERAL);
3316+
mapData.Mappers.push_back(nullptr);
33063317
}
33073318
mapData.Names.push_back(LLVM::createMappingInformation(
33083319
mapOp.getLoc(), *moduleTranslation.getOpenMPBuilder()));

0 commit comments

Comments
 (0)