[all-commits] [llvm/llvm-project] e5e55c: [GlobalMerge][NFC] Skip sorting by profitability w...

Michael Maitland via All-commits all-commits at lists.llvm.org
Fri Jan 24 06:08:57 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e5e55c04d6af4ae32c99d574f59e632595abf607
      https://github.com/llvm/llvm-project/commit/e5e55c04d6af4ae32c99d574f59e632595abf607
  Author: Michael Maitland <michaeltmaitland at gmail.com>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M llvm/lib/CodeGen/GlobalMerge.cpp

  Log Message:
  -----------
  [GlobalMerge][NFC] Skip sorting by profitability when it is not needed (#124146)

We were previously sorting by profitability even if we were choosing to
merge all globals together, which is not impacted by UsedGlobalSet
order.

We can also remove iteration of UsedGlobalSets in reverse order in both
cases. In the first csae, the order does not matter. In the second case,
we just sort by the order we need instead of sorting in the opposite
direction and calling reverse.

This change should only be an improvement on compile time. I have not
measured it, but I think it would never make things worse.



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