Skip to content

Commit 9d26c6b

Browse files
authored
[MLIR][OpenMP] remove now unnecessary getUsedValuesDefinedAbove call from convertTargetOp (llvm#72904)
This block of code was here to create pseudo handling of implicit captures in target regions to prevent gfortran test regressions and allow certain pieces of code to function, however, with the introduction of the IFA patch which adds proper handling of implicits by adding them to the map operands list alongside explicit mappings at the initial Fortran -> MLIR generation phase this should no longer be required and may cause some adverse affects at worse in the future.
1 parent 9250fbd commit 9d26c6b

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,23 +2445,6 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
24452445
kernelInput.push_back(mapData.OriginalValue[i]);
24462446
}
24472447

2448-
// Do some very basic handling of implicit captures that are caught
2449-
// by use in the target region.
2450-
// TODO/FIXME: Remove on addition of IsolatedFromAbove patch series
2451-
// as this will become redundant and perhaps erroneous in cases
2452-
// where more complex implicit capture semantics are required.
2453-
llvm::SetVector<Value> uses;
2454-
getUsedValuesDefinedAbove(targetRegion, uses);
2455-
2456-
for (mlir::Value use : uses) {
2457-
llvm::Value *useValue = moduleTranslation.lookupValue(use);
2458-
if (useValue &&
2459-
!std::any_of(
2460-
mapData.OriginalValue.begin(), mapData.OriginalValue.end(),
2461-
[&](llvm::Value *mapValue) { return mapValue == useValue; }))
2462-
kernelInput.push_back(useValue);
2463-
}
2464-
24652448
builder.restoreIP(moduleTranslation.getOpenMPBuilder()->createTarget(
24662449
ompLoc, allocaIP, builder.saveIP(), entryInfo, defaultValTeams,
24672450
defaultValThreads, kernelInput, genMapInfoCB, bodyCB, argAccessorCB));

0 commit comments

Comments
 (0)