[all-commits] [llvm/llvm-project] 5bbce0: [PseudoProbe] Mix block and call probe ID in lexic...

Lei Wang via All-commits all-commits at lists.llvm.org
Wed Apr 3 11:18:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bbce06ac642bedcb93158ed04253cf6deedf5e6
      https://github.com/llvm/llvm-project/commit/5bbce06ac642bedcb93158ed04253cf6deedf5e6
  Author: Lei Wang <wlei at fb.com>
  Date:   2024-04-03 (Wed, 03 Apr 2024)

  Changed paths:
    M clang/test/CodeGen/pseudo-probe-emit.c
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
    M llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
    M llvm/test/Transforms/SampleProfile/Inputs/pseudo-probe-profile.prof
    M llvm/test/Transforms/SampleProfile/Inputs/pseudo-probe-update.prof
    M llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-invoke.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-update.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll

  Log Message:
  -----------
  [PseudoProbe] Mix block and call probe ID in lexical order (#75092)

Before all the call probe ids are after block ids, in this change, it
mixed the call probe and block probe by reordering them in
lexical(line-number) order. For example:
```
main():
BB1
if(...) 
  BB2 foo(..);   
else 
  BB3 bar(...);
BB4
```
Before the profile is
```
main
 1: ..
 2: ..
 3: ...
 4: ...
 5: foo ...
 6: bar ...
 ```
 Now the new order is
```
 main
 1: ..
 2: ..
 3: foo ...
 4: ...
 5: bar ...
 6: ...
```
This can potentially make it more tolerant of profile mismatch, either from stale profile or frontend change. e.g. before if we add one block, even the block is the last one, all the call probes are shifted and mismatched. Moreover, this makes better use of call-anchor based stale profile matching. Blocks are matched based on the closest anchor, there would be more anchors used for the matching, reduce the mismatch scope.



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