[all-commits] [llvm/llvm-project] b607ac: Changes:

Mingming Liu via All-commits all-commits at lists.llvm.org
Wed Jun 12 23:30:38 PDT 2024


  Branch: refs/heads/users/minglotus-6/spr/icpass
  Home:   https://github.com/llvm/llvm-project
  Commit: b607ac36cac2d2cd276df8ec5a9879ae5ef426fe
      https://github.com/llvm/llvm-project/commit/b607ac36cac2d2cd276df8ec5a9879ae5ef426fe
  Author: mingmingl <mingmingl at google.com>
  Date:   2024-06-12 (Wed, 12 Jun 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/IndirectCallVisitor.h
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
    M llvm/lib/Transforms/Utils/InlineFunction.cpp

  Log Message:
  -----------
  Changes:
1. Resolve review comments
2. Use unordered_map rather than SmallDenseMap for a couple of maps.
   - unordered_map calls allocator for each element, and (Small)DenseMap
     allocate elements in batch. But DenseMap size grows aggressively
     under size 64 [1] so not memory efficient.
3. Use stable_sort when sorting <target, count> pairs by count.
4. Only update VPtr value profiles if 'EnableVTableValueProfile' is true
   and 'VPtr' has profiles.

[1] DenseMap https://github.com/llvm/llvm-project/blob/092dbfaad257885692fa64559e9eb43a5c466798/llvm/include/llvm/ADT/DenseMap.h#L849
    SmallDenseMap https://github.com/llvm/llvm-project/blob/092dbfaad257885692fa64559e9eb43a5c466798/llvm/include/llvm/ADT/DenseMap.h#L1088



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