[all-commits] [llvm/llvm-project] d6cd21: [ThinLTO][LowerTypeTests] Don't compute address ta...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Tue Dec 3 12:14:37 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d6cd214dd6ae35ea50be4fdc296ef9091f762375
      https://github.com/llvm/llvm-project/commit/d6cd214dd6ae35ea50be4fdc296ef9091f762375
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2024-12-03 (Tue, 03 Dec 2024)

  Changed paths:
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp

  Log Message:
  -----------
  [ThinLTO][LowerTypeTests] Don't compute address taken set unless CFI (NFC) (#118508)

The AddressTaken set used for CFI with regular LTO was being computed on
the ExportSummary regardless of whether any CFI metadata existed. In the
case of ThinLTO, the ExportSummary is the global summary index for the
target, and the lack of guard in this code meant this was being computed
on the ThinLTO index even when there was an empty regular LTO module,
since the backend is called on the combined module to generate the
expected output file (normally this is trivial as there is no IR).

Move the computation of the AddressTaken set into the condition checking
for CFI to avoid this overhead. This change resulted in a 20% speedup in
the thin link of a large target. It looks like the outer loop has
existed here for several years, but likely became a larger overhead
after the inner loop was added very recently in PR113987.

I will send a separate patch to refactor the ThinLTO backend handling to
avoid invoking the opt pipeline if the module is empty, in case there
are other summary-based analyses in some of the passes now or in the
future. This change is still desireable as by default regular LTO
modules contain summaries, or we can have split thin and regular LTO
modules, and if they don't involve CFI these would still unnecessarily
compute the AddressTaken set.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list