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

Add edges vector to CodeInstance/CodeInfo to keep backedges as edges #54894

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Commits on Oct 23, 2024

  1. add edges metadata field to CodeInfo/CodeInstance, prepare for using

    This records all invoke targets as edges as a functionality test, before
    finishing the implementation of recording the edges accurately during
    inference (via backedges + inference).
    vtjnash authored and aviatesk committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    904d459 View commit details
    Browse the repository at this point in the history
  2. inference: compute edges more precisely in post-inference

    Start computing edges from stmt_info later (after CodeInstance is able
    to have been allocated for recursion) instead of immediately.
    vtjnash authored and aviatesk committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    2a7ba03 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bd8b204 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    01838f9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5f7fa3f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2b74dd4 View commit details
    Browse the repository at this point in the history
  7. propagate results of _hasmethod/applicable using MethodResultPure

    To avoid calling `add_edges!` directly.
    In fact, it might be better to define something like
    `VirtualizedCallInfo` rather than using `MethodResultPure`.
    aviatesk committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    aa93701 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4d1a1f1 View commit details
    Browse the repository at this point in the history
  9. make CallInfo propagate the edges list of CodeInstances

    Remaining TODOs:
    - Finalize the format for `sv.edges`. There might be cases where no
      `edge::CodeInstance` exists as a result of `abstract_call_method`,
      and in such cases, we might still need to use `MethodInstance` in the
      `edges` list.
    - Ensure that when the local caching mode is specified (i.e. for
      const-prop'ed calls and call-site-inlined calls), the const-propped
      edge should be propagated instead of the regular edge.
    - Make use of the `CodeInstance` held by `CallInfo` during inlining
      for slightly better performance by avoiding the global cache lookup.
    aviatesk committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    a6e7b20 View commit details
    Browse the repository at this point in the history