================ @@ -4438,14 +4546,49 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder, findAllocaInsertPoint(builder, moduleTranslation); llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder); + llvm::OpenMPIRBuilder::TargetDataInfo info( + /*RequiresDevicePointerInfo=*/false, + /*SeparateBeginEndCalls=*/true); + llvm::Value *ifCond = nullptr; + if (Value targetIfCond = targetOp.getIfExpr()) + ifCond = moduleTranslation.lookupValue(targetIfCond); + + auto customMapperCB = [&](unsigned int i) { + llvm::Value *mapperFunc = nullptr; + if (combinedInfos.Mappers[i]) { + info.HasMapper = true; + llvm::Expected<llvm::Function *> newFn = getOrCreateUserDefinedMapperFunc( + combinedInfos.Mappers[i], builder, moduleTranslation); + assert(newFn && "Expect a valid mapper function is available"); + mapperFunc = *newFn; + } + return mapperFunc; + }; + + llvm::OpenMPIRBuilder::TargetDataInfo info( + /*RequiresDevicePointerInfo=*/false, + /*SeparateBeginEndCalls=*/true); + + auto customMapperCB = [&](unsigned int i) { + llvm::Value *mapperFunc = nullptr; + if (combinedInfos.Mappers[i]) { + info.HasMapper = true; + llvm::Expected<llvm::Function *> newFn = getOrCreateUserDefinedMapperFunc( + combinedInfos.Mappers[i], builder, moduleTranslation); + assert(newFn && "Expect a valid mapper function is available"); + mapperFunc = *newFn; + } + return mapperFunc; + }; ---------------- skatrak wrote:
Looks like this got copy-pasted twice. https://github.com/llvm/llvm-project/pull/124746 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits