[all-commits] [llvm/llvm-project] 2fa059: [MemProf] Use remove_if to erase MapVector element...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Mon Jun 3 20:44:14 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2fa059195bb54f422cc996db96ac549888268eae
      https://github.com/llvm/llvm-project/commit/2fa059195bb54f422cc996db96ac549888268eae
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

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

  Log Message:
  -----------
  [MemProf] Use remove_if to erase MapVector elements in bulk (#94269)

A cycle profile showed that we were spending a lot of time invoking
MapVector::erase. According to
https://llvm.org/docs/ProgrammersManual.html#llvm-adt-mapvector-h,
erasing elements one at a time is very inefficient for MapVector and it
is better to use remove_if.

This change resulted in around 7% time reduction on a large thin link.

While here remove an unused function that also invokes erase on
MapVectors.



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