Skip to content

ZJIT: LoopInfo could use a simpler single-pass algorithm #1034

Description

@XrXr

A New Algorithm for Identifying Loops in Decompilation, SAS 2007 (The 14th International Static Analysis Symposium) showed that you can identify loops in a single DFS, without the help of a dominator tree. It's simpler than our current implementation which does use a dom tree, and it's also more general since it works on graphs that have irreducible loops.

LLVM recently switched to this approach (llvm/llvm-project#212000) and the author also have a post on the topic: https://maskray.me/blog/irreducible-loops. Unfortunately the primary source is behind a paywall.

We only use LoopInfo for debug output (iongraph) at the moment, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions