[all-commits] [llvm/llvm-project] 245e60: [LoopSink] Exit loop finding BBs to sink into earl...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Tue Jul 30 13:09:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 245e6070daa191b1fc6ce05d8fc38a74f918159a
      https://github.com/llvm/llvm-project/commit/245e6070daa191b1fc6ce05d8fc38a74f918159a
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2024-07-30 (Tue, 30 Jul 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopSink.cpp

  Log Message:
  -----------
  [LoopSink] Exit loop finding BBs to sink into early when possible (NFC) (#101115)

As noted in the comments, findBBsToSinkInto is
   O(UseBBs.size() * ColdLoopBBs.size())

A very large function with a huge loop was incurring a high compile time
in this code. The size of the ColdLoopBBs set was over 14K. There is a
limit on the size of the UseBBs set, but not the ColdLoopBBs (and adding
a limit for the latter actually slowed down some later passes).

This change exits the loop early once we detect that there is no further
refinement possible for the BBsToSinkInto set. This is possible because
the ColdLoopBBs set is sorted in ascending magnitude of frequency.

This cut down the LoopSinkPass time by around 33% (78s to just over
50s).



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