[all-commits] [llvm/llvm-project] e20b90: [PseudoProbe] Make probe discriminator compatible ...

Lei Wang via All-commits all-commits at lists.llvm.org
Fri Jun 7 11:38:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e20b90472160e47112886d959bbe0bbeff50b8ee
      https://github.com/llvm/llvm-project/commit/e20b90472160e47112886d959bbe0bbeff50b8ee
  Author: Lei Wang <wlei at fb.com>
  Date:   2024-06-07 (Fri, 07 Jun 2024)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/include/llvm/IR/PseudoProbe.h
    M llvm/lib/IR/PseudoProbe.cpp
    M llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
    M llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-emit-inline.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll

  Log Message:
  -----------
  [PseudoProbe] Make probe discriminator compatible with dwarf base discriminator (#94506)

It's useful if the probe-based build can consume a dwarf based
profile(e.g. the profile transition), before there is a conflict for the
discriminator, this change tries to mitigate the issue by encoding the
dwarf base discriminator into the probe discriminator.
As the num of probe id(num of basic block and calls) starts from 1,
there are some unused space. We try to reuse some bit of the probe id.
The new encode rule is:
- Use a bit to [28:28] to indicate whether dwarf base discriminator is
encoded.(fortunately we can borrow this bit from the `PseudoProbeType`)
- If the bit is set, use [15:3] for probe id, [18:16] for dwarf base
discriminator. Otherwise, still use [18:3] for probe id.

Note that these doesn't affect the original probe id capacity, we still
prioritize probe id encoding, i.e. the base discriminator is not encoded
when probe id is bigger than [15:3].
 
Then adjust `getBaseDiscriminatorFromDiscriminator` to use the base
discriminator from the probe discriminator.



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