diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp --- a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp @@ -160,7 +160,7 @@ llvm::StringRef pathRef(path.data(), path.size()); std::unique_ptr library = llvm::getLazyIRFileModule(pathRef, error, context); - path.set_size(dirLength); + path.truncate(dirLength); if (!library) { getOperation().emitError() << "Failed to load library " << file << " from " << path << error.getMessage();