[Mlir-commits] [mlir] b12e033 - [MLIR][GPU] Truncate temp filename path size to avoid linux limitations (#155108)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Aug 23 09:29:04 PDT 2025
Author: William Moses
Date: 2025-08-23T16:29:01Z
New Revision: b12e03315aaa571c5a65cacd05e71fc6d068b1df
URL: https://github.com/llvm/llvm-project/commit/b12e03315aaa571c5a65cacd05e71fc6d068b1df
DIFF: https://github.com/llvm/llvm-project/commit/b12e03315aaa571c5a65cacd05e71fc6d068b1df.diff
LOG: [MLIR][GPU] Truncate temp filename path size to avoid linux limitations (#155108)
Linux has a limitation of 256 characters for a path. Large function
names being serialized will cause this to fail. As createTemporaryFile
already unique's the file (up to 128 retries for different name
variations), truncating should suffice
Added:
Modified:
mlir/lib/Target/LLVM/NVVM/Target.cpp
Removed:
################################################################################
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::TmpFile>
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) {
More information about the Mlir-commits
mailing list