Skip to content

Commit d43ed06

Browse files
committed
Revert "[OpenMP][MLIR] Preserve to/from flags in mapper base entry for mappers (llvm#159799)"
This reverts commit 8afea0d.
1 parent fa37976 commit d43ed06

File tree

3 files changed

+8
-71
lines changed

3 files changed

+8
-71
lines changed

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

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4299,30 +4299,13 @@ mapParentWithMembers(LLVM::ModuleTranslation &moduleTranslation,
42994299
assert(!ompBuilder.Config.isTargetDevice() &&
43004300
"function only supported for host device codegen");
43014301

4302-
// Map the first segment of the parent. If a user-defined mapper is attached,
4303-
// include the parent's to/from-style bits (and common modifiers) in this
4304-
// base entry so the mapper receives correct copy semantics via its 'type'
4305-
// parameter. Also keep TARGET_PARAM when required for kernel arguments.
4306-
llvm::omp::OpenMPOffloadMappingFlags baseFlag =
4307-
isTargetParams
4302+
// Map the first segment of our structure
4303+
const size_t parentIndex = combinedInfo.Types.size();
4304+
combinedInfo.Types.emplace_back(
4305+
(targetDirective == TargetDirective::Target &&
4306+
!mapData.IsDeclareTarget[mapDataIndex])
43084307
? llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_TARGET_PARAM
4309-
: llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_NONE;
4310-
4311-
// Detect if this mapping uses a user-defined mapper.
4312-
bool hasUserMapper = mapData.Mappers[mapDataIndex] != nullptr;
4313-
if (hasUserMapper) {
4314-
using mapFlags = llvm::omp::OpenMPOffloadMappingFlags;
4315-
// Preserve relevant map-type bits from the parent clause. These include
4316-
// the copy direction (TO/FROM), as well as commonly used modifiers that
4317-
// should be visible to the mapper for correct behaviour.
4318-
mapFlags parentFlags = mapData.Types[mapDataIndex];
4319-
mapFlags preserve = mapFlags::OMP_MAP_TO | mapFlags::OMP_MAP_FROM |
4320-
mapFlags::OMP_MAP_ALWAYS | mapFlags::OMP_MAP_CLOSE |
4321-
mapFlags::OMP_MAP_PRESENT | mapFlags::OMP_MAP_OMPX_HOLD;
4322-
baseFlag |= (parentFlags & preserve);
4323-
}
4324-
4325-
combinedInfo.Types.emplace_back(baseFlag);
4308+
: llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_NONE);
43264309
combinedInfo.DevicePointers.emplace_back(
43274310
mapData.DevicePointers[mapDataIndex]);
43284311
combinedInfo.Mappers.emplace_back(mapData.Mappers[mapDataIndex]);

offload/test/offloading/fortran/target-declare-mapper-allocatable.f90

Lines changed: 0 additions & 48 deletions
This file was deleted.

revert_patches.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ needs more offload patches
1919
[Offload] Port llvm-offload-device-info to new offload API (#155626)
2020
[Offload] Implement 'olIsValidBinary' in offload
2121
---
22+
akashB: 8afea0d0ea1c [OpenMP][MLIR] Preserve to/from flags in mappe
23+
---

0 commit comments

Comments
 (0)