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

switch to a new CFG selection logic #116

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Commits on Sep 10, 2024

  1. switch to a new CFG selection logic

    This commit aims to port the new CFG selection logic implemented in
    aviatesk/JET.jl#654 to LCU, so that it can be shared between LCU and JET.
    
    The new algorithm is based on what was proposed in [Wei84][^Wei84]. If there is
    even one active block in the blocks reachable from a conditional branch
    up to its successors' nearest common post-dominator (referred to as
    "𝑰𝑵𝑭𝑳" in the paper), it is necessary to follow that conditional
    branch and execute the code. Otherwise, execution can be
    short-circuited[^short-circuit] from the conditional branch to the
    nearest common post-dominator.
    
    Regarding the `GotoNode`, it is now marked only for active blocks after
    all requirements have converged, rather than marking it inside the
    `add_loop!` or such. This approach eliminates the need to add
    unnecessary blocks inside the loop, and the need to use `add_loop!`
    while allowing the required CFG to be executed safely.
    
    [^Wei84]: M. Weiser, "Program Slicing," IEEE Transactions on Software Engineering, 10, pages 352-357, July 1984. https://ieeexplore.ieee.org/document/5010248
    
    [^short-circuit]: It is important to note that in Julia's IR (`CodeInfo`),
      "short-circuiting" a specific code region is not a simple task. Simply
      ignoring the path to the post-dominator does not guarantee fall-through
      to the post-dominator. Therefore, a more careful implementation is
      required for this aspect.
    aviatesk committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    1a398ab View commit details
    Browse the repository at this point in the history
  2. remove add_loops!

    aviatesk committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    fb5896d View commit details
    Browse the repository at this point in the history