REVERT-disable-autoupgrading-debug-info.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 54969766fd2029c506befc46e9ce14d67c7ed02a Mon Sep 17 00:00:00 2001
  2. From: Arthur Eubanks <aeubanks@google.com>
  3. Date: Tue, 25 Apr 2023 03:05:19 +0000
  4. Subject: [PATCH] Reland [clang] Disable autoupgrading debug info in ThinLTO
  5. builds
  6. ThinLTO reads bitcode many times and attempts to upgrade the debug info every time. This is expensive since it calls the verifier. We don't need this given all LLVM bitcode producers are from the same version of LLVM.
  7. For just the build step that runs ThinLTO and links official Chrome, measured 34T -> 32T instructions via perf stat.
  8. Reland disables adding flag for ChromeOS since that toolchain is too old to have this flag.
  9. Bug: 972449
  10. Change-Id: I44552dd6c9dc71683c002d0c885e78b2a4341659
  11. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4470209
  12. Reviewed-by: Nico Weber <thakis@chromium.org>
  13. Commit-Queue: Arthur Eubanks <aeubanks@google.com>
  14. Cr-Commit-Position: refs/heads/main@{#1135007}
  15. ---
  16. build/config/compiler/BUILD.gn | 9 +++++++++
  17. 1 file changed, 9 insertions(+)
  18. diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
  19. index 1c13bc80f0f..53db095c1b1 100644
  20. --- a/build/config/compiler/BUILD.gn
  21. +++ b/build/config/compiler/BUILD.gn
  22. @@ -685,6 +685,7 @@ config("compiler") {
  23. "/lldltocache:" +
  24. rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
  25. "/lldltocachepolicy:$cache_policy",
  26. + "-mllvm:-disable-auto-upgrade-debug-info",
  27. ]
  28. } else {
  29. ldflags += [ "-flto=thin" ]
  30. @@ -725,6 +726,14 @@ config("compiler") {
  31. }
  32. ldflags += [ "-Wl,-mllvm,-import-instr-limit=$import_instr_limit" ]
  33. +
  34. + if (!is_chromeos) {
  35. + # TODO(https://crbug.com/972449): turn on for ChromeOS when that
  36. + # toolchain has this flag.
  37. + # We only use one version of LLVM within a build so there's no need to
  38. + # upgrade debug info, which can be expensive since it runs the verifier.
  39. + ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ]
  40. + }
  41. }
  42. # TODO(https://crbug.com/1211155): investigate why this isn't effective on