[all-commits] [llvm/llvm-project] fffe27: [ADT] Make set_subtract more efficient when subtra...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Wed Jul 17 13:53:32 PDT 2024


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

  Changed paths:
    M llvm/include/llvm/ADT/SetOperations.h

  Log Message:
  -----------
  [ADT] Make set_subtract more efficient when subtrahend is larger (NFC) (#98702)

If the subtrahend is larger, iterate the minuend set instead.

Noticed when subtracting a large set from a number of other smaller
sets for an upcoming MemProf change, this change makes that much faster.

I subsequently found a couple of callsites in one file that were calling
set_subtract with a vector subtrahend, which doesn't have the "count()"
interface. Add a separate helper for subtracting a vector.



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