Disable use list order on the gold plugin.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 22 Dec 2015 23:45:49 +0000 (23:45 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 22 Dec 2015 23:45:49 +0000 (23:45 +0000)
It turns out that his is *really* slow. With this change the link of
clang with plugin-opt=emit-llvm goes from 41 to 26 seconds.

We can add an option to enable it again if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256302 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gold/gold-plugin.cpp

index b6acea76dc3c8954c16cd3f168ddb323d266dba7..31d7f156a7004d1c08940ef12d7bf24fc1493853 100644 (file)
@@ -756,7 +756,7 @@ static void saveBCFile(StringRef Path, Module &M) {
   raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None);
   if (EC)
     message(LDPL_FATAL, "Failed to write the output file.");
-  WriteBitcodeToFile(&M, OS, /* ShouldPreserveUseListOrder */ true);
+  WriteBitcodeToFile(&M, OS, /* ShouldPreserveUseListOrder */ false);
 }
 
 static void codegen(std::unique_ptr<Module> M) {