From a80db473cd165e2cdf96d12061fdd94a341933cf Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sat, 23 Aug 2025 11:17:13 -0500 Subject: [PATCH] [MLIR][GPU] Truncate temp filename path size to avoid linux limitations --- mlir/lib/Target/LLVM/NVVM/Target.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp index 62eaadb3d16b1..8760ea8588e2c 100644 --- a/mlir/lib/Target/LLVM/NVVM/Target.cpp +++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp @@ -267,6 +267,8 @@ NVPTXSerializer::NVPTXSerializer(Operation &module, NVVMTargetAttr target, std::optional NVPTXSerializer::createTemp(StringRef name, StringRef suffix) { llvm::SmallString<128> filename; + if (name.size() > 80) + name = name.substr(0, 80); std::error_code ec = llvm::sys::fs::createTemporaryFile(name, suffix, filename); if (ec) {