Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC][Transforms][IPO] Add func suffix in ArgumentPromotion and DeadArgumentElimination #109899

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 6, 2024

  1. [RFC][Transforms][IPO] Add func suffix in ArgumentPromotion and DeadA…

    …rgumentElimination
    
    ArgumentPromotion and DeadArgumentElimination passes could change
    function signatures but the function name remains the same as before
    the transformation. This makes it hard for tracing with bpf programs
    where user tends to use function signature in the source.
    See discussion [1] for details.
    
    This patch added suffix to functions whose signatures
    are changed. The suffix lets users know that function
    signature has changed and they need to impact the IR or binary
    to find modified signature before tracing those functions.
    
    The suffix for ArgumentPromotion is ".argprom" and
    the suffix for DeadArgumentElimination is ".argelim".
    The suffix also gives user hints about what kind of
    transformation has been done.
    
    With this patch, I built a recent linux kernel with
    full LTO enabled. I got 4 functions with only argpromotion like
      set_track_update.argelim.argprom
      pmd_trans_huge_lock.argprom
      ...
    I got 1058 functions with only deadargelim like
      process_bit0.argelim
      pci_io_ecs_init.argelim
      ...
    I got 3 functions with both argpromotion and deadargelim
      set_track_update.argelim.argprom
      zero_pud_populate.argelim.argprom
      zero_pmd_populate.argelim.argprom
    
    There are some concerns about func suffix may impact sample based
    profiling. I did some experiments and show that this is not the
    case. The sample profiling gets func name from dwarf and those
    func names in dwarf does not have suffixes added by this patch
    and sample profiling works fine with this patch.
    
      [1] llvm#104678
    Yonghong Song committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    c4a3ffd View commit details
    Browse the repository at this point in the history