[all-commits] [llvm/llvm-project] 6bfb6d: [SmallPtrSet] Optimize contains (NFC) (#118092)

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Nov 29 12:54:22 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bfb6d4092a284e1fcd135625c0e713d019f0572
      https://github.com/llvm/llvm-project/commit/6bfb6d4092a284e1fcd135625c0e713d019f0572
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-11-29 (Fri, 29 Nov 2024)

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

  Log Message:
  -----------
  [SmallPtrSet] Optimize contains (NFC) (#118092)

Instead of going through find_imp(), implement a specialized
contains_imp() that directly returns a boolean instead of a pointer that
needs to be compared to EndPointer().

This gives a compile-time improvement of around 0.2-0.3%.



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