diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp index cbbd37fe0e06dc..b0ec0fb6e56057 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp @@ -3709,6 +3709,12 @@ LogicalResult OpenMPDialectLLVMIRTranslationInterface::amendOperation( } static bool isInternalTargetDeviceOp(Operation *op) { + // TargetDataOp's contain regions of both host + // and device code, so we must lower these as if + // they are declare target functions. + if (isa(op)) + return true; + // Assumes no reverse offloading if (op->getParentOfType()) return true;