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 more iterators to JIT #52515

Merged
merged 20 commits into from
Jun 7, 2021
Merged

Commits on Jun 7, 2021

  1. Add more JIT data structure iterators

    1. Make more BasicBlock members `const`.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    691fb23 View commit details
    Browse the repository at this point in the history
  2. Convert all non-phi statement iteration to the form:

    `for (Statement* stmt : blk->NonPhiStatements())`
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    259d8b8 View commit details
    Browse the repository at this point in the history
  3. BasicBlock iterator

    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    29b3002 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0c6f04c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    df142e5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7c2d365 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    794bc30 View commit details
    Browse the repository at this point in the history
  8. Add GenTree iterator

    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    4fcbc2c View commit details
    Browse the repository at this point in the history
  9. Mark Statement pointer as const in iterators

    This matches the style used for block and GenTree iterators, and prevents
    errors where changing the stmt pointer expects the iterator location to change.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    dabf463 View commit details
    Browse the repository at this point in the history
  10. Formatting

    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    f03d4b3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    99d7d5b View commit details
    Browse the repository at this point in the history
  12. Add overloads for Compiler::Blocks()

    With this change, all block iteration can start from Compiler::Block():
    ```
    for (BasicBlock* const block : compiler->Blocks()) ...
    for (BasicBlock* const block : compiler->Blocks(startBlock)) ...
    for (BasicBlock* const block : compiler->Blocks(startBlock, endBlock)) ...
    ```
    
    The second two could be `static`, but I haven't done that.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    5e93982 View commit details
    Browse the repository at this point in the history
  13. Add iterator for switch targets

    E.g.:
    ```
    for (BasicBlock* const target : block->SwitchTargets())
    ```
    
    Also, (1) reverted one LSRA block iterator, (2) tweaked
    LSRA block ordering dump.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    75711d1 View commit details
    Browse the repository at this point in the history
  14. Fix Linux build

    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    57d9fa4 View commit details
    Browse the repository at this point in the history
  15. Add iterator for block successors

    e.g.,
    
        for (BasicBlock* const succ : block->Succs())
    
    This is equivalent to looping using NumSucc() and GetSucc() using the
    versions which don't take a `Compiler*`.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    91108db View commit details
    Browse the repository at this point in the history
  16. Fix BBJ_COND block iteration

    If fall-through and branch destinations are identical, only
    iterate over one.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    33f0706 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a3f3d40 View commit details
    Browse the repository at this point in the history
  18. Move single-use iterator implementations to be nested classes

    For simplicity and consistency.
    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    ea48595 View commit details
    Browse the repository at this point in the history
  19. Fix merge issue

    BruceForstall committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    729a34c View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    828bf32 View commit details
    Browse the repository at this point in the history