Skip to content

JIT: optInvertLoops depends on bbNum ordering but doesn't guarantee it #80809

Closed

Description

@AndyAyersMS

While working on moving pred list building earlier I am seeing spurious diffs from optInvertLoops.

Looks like it expects blocks to have been renumbered but it doesn't check or try and renumber. Morph (which is a bit upstream) will often renumber so this only impacts a small set of methods.

for (BasicBlock* const predBlock : bTest->PredBlocks())
{
unsigned bNum = predBlock->bbNum;
if ((loopFirstNum <= bNum) && (bNum <= loopBottomNum))
{
// Looks like the predecessor is from within the potential loop; skip it.
continue;
}

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Jan 18, 2023
  2. ghost added
    untriaged
    on Jan 18, 2023
  3. self-assigned this
    on Jan 18, 2023
  4. removed
    untriaged
    on Jan 18, 2023
  5. added this to the 8.0.0 milestone on Jan 18, 2023
  6. AndyAyersMS commented on Jan 18, 2023

    @AndyAyersMS
    MemberAuthor

    cc @BruceForstall

    I will fix this as a one-off. Seems like we might be on the verge of phases having checked preconditions or something...

  7. BruceForstall commented on Jan 18, 2023

    @BruceForstall
    Contributor

    Seems like we might be on the verge of phases having checked preconditions

    That would be useful. I've found various places which depend on bbNum ordering when it's not clear they are properly ordered.

  8. added a commit that references this issue on Jan 19, 2023
    329eb2e
  9. ghost added
    in-pr
    on Jan 19, 2023
  10. ghost removed
    in-pr
    on Jan 19, 2023
  11. added a commit that references this issue on Jan 24, 2023
    f09aa65
  12. ghost locked as resolved and limited conversation to collaborators on Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions