Skip to content

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

@AndyAyersMS

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;
}

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions