From aaae64d0a03752e43273cc3285ec35674398969f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 31 Oct 2025 17:28:58 +0100 Subject: [PATCH] [LTO] Preserve use list order in save-temps save-temps is debugging functionality, so it should preserve use-lists to keep the optimization/codegen behavior of the dumped bitcode as close to the in-memory IR as possible. --- llvm/lib/LTO/LTOBackend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index 93118becedbac..8efde8efb3cb1 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -124,7 +124,7 @@ Error Config::addSaveTemps(std::string OutputFileName, bool UseInputModulePath, // directly and exit. if (EC) reportOpenError(Path, EC.message()); - WriteBitcodeToFile(M, OS, /*ShouldPreserveUseListOrder=*/false); + WriteBitcodeToFile(M, OS, /*ShouldPreserveUseListOrder=*/true); return true; }; };