diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp index a9d9d0b2a4c1ca8..f734f61d8235f1d 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp @@ -552,7 +552,7 @@ convertIgnoredWrapper(omp::LoopWrapperInterface opInst, forwardArgs(blockArgIface.getPrivateBlockArgs(), op.getPrivateVars()); forwardArgs(blockArgIface.getReductionBlockArgs(), op.getReductionVars()); - op.emitWarning() << "simd information on composite construct discarded"; + op.emitWarning() << "simd XXXX information on composite construct discarded"; return success(); }) .Default([&](Operation *op) { @@ -4241,7 +4241,7 @@ LogicalResult convertFlagsAttr(Operation *op, mlir::omp::FlagsAttr attribute, return success(); } -static bool getTargetEntryUniqueInfo(llvm::TargetRegionEntryInfo &targetInfo, +static void getTargetEntryUniqueInfo(llvm::TargetRegionEntryInfo &targetInfo, omp::TargetOp targetOp, llvm::StringRef parentName = "") { auto fileLoc = targetOp.getLoc()->findInstanceOf(); @@ -4250,15 +4250,16 @@ static bool getTargetEntryUniqueInfo(llvm::TargetRegionEntryInfo &targetInfo, StringRef fileName = fileLoc.getFilename().getValue(); llvm::sys::fs::UniqueID id; + uint64_t line = fileLoc.getLine(); if (auto ec = llvm::sys::fs::getUniqueID(fileName, id)) { - targetOp.emitError("Unable to get unique ID for file"); - return false; + size_t fileHash = llvm::hash_value(fileName.str()); + size_t deviceId = 0xdeadf17e; + targetInfo = llvm::TargetRegionEntryInfo(parentName, deviceId, + fileHash, line); + } else { + targetInfo = llvm::TargetRegionEntryInfo(parentName, id.getDevice(), + id.getFile(), line); } - - uint64_t line = fileLoc.getLine(); - targetInfo = llvm::TargetRegionEntryInfo(parentName, id.getDevice(), - id.getFile(), line); - return true; } static void @@ -4811,8 +4812,7 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder, llvm::TargetRegionEntryInfo entryInfo; - if (!getTargetEntryUniqueInfo(entryInfo, targetOp, parentName)) - return failure(); + getTargetEntryUniqueInfo(entryInfo, targetOp, parentName); llvm::OpenMPIRBuilder::InsertPointTy allocaIP = findAllocaInsertPoint(builder, moduleTranslation);