[all-commits] [llvm/llvm-project] 470f55: [Transforms][IPO] Add remarks for ArgumentPromotio...

yonghong-song via All-commits all-commits at lists.llvm.org
Sat Aug 31 10:42:15 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 470f55facd083d20d429266de91e4cba15c80ff7
      https://github.com/llvm/llvm-project/commit/470f55facd083d20d429266de91e4cba15c80ff7
  Author: yonghong-song <yhs at fb.com>
  Date:   2024-08-31 (Sat, 31 Aug 2024)

  Changed paths:
    M llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
    M llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
    M llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
    M llvm/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll

  Log Message:
  -----------
  [Transforms][IPO] Add remarks for ArgumentPromotion and DeadArgumentE… (#105740)

…limination

ArgumentPromotion and DeadArgumentElimination passes may change function
signature. This makes bpf tracing difficult since users either not aware
of signature change or need to poke into IR or assembly to understand
the function signature change.

This patch enabled to emit some remarks so if recompiling with
-foptimization-record-file=<file>, users can check remarks to see what
kind of signature changes for a particular function. The following are
some examples for implemented remarks:
```
  Pass:            deadargelim
  Name:            ReturnValueRemoved
  DebugLoc:        { File: 'bpf-next/net/mptcp/protocol.c', Line: 572, Column: 0 }
  Function:        mptcp_check_data_fin
  Args:
    - String:          'removing return value '
    - String:          '0'

  Pass:            deadargelim
  Name:            ArgumentRemoved
  DebugLoc:        { File: 'bpf-next/kernel/bpf/syscall.c', Line: 1670, Column: 0 }
  Function:        map_delete_elem
  Args:
      - String:          'eliminating argument '
      - ArgName:         uattr.coerce0
      - String:          '('
      - ArgIndex:        '1'
      - String:          ')'

  Pass:            argpromotion
  Name:            ArgumentPromoted
  DebugLoc:        { File: 'bpf-next/net/mptcp/protocol.h', Line: 570, Column: 0 }
  Function:        mptcp_subflow_ctx
  Args:
    - String:          'promoting argument '
    - ArgName:         sk
    - String:          '('
    - ArgIndex:        '0'
    - String:          ')'
    - String:          ' to pass by value'
```
  [1] https://github.com/llvm/llvm-project/issues/104678



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