Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: Port VN and loop hoisting to new loop representation (#95589)
Switch VN to use the new loop representation for the limited amount of stuff it does. This is mainly computing loop side effects and using it for some more precision, in addition to storing some memory dependencies around loops. It requires us to have a block -> loop mapping, so add a BlockToNaturalLoopMap class to do this. We really do not need this functionality for much, so we may consider seeing if we can remove it in the future (and remove BasicBlock::bbNatLoopNum). In loop hoisting move a few members out of LoopDsc and into LoopHoistContext; in particular the counts of hoisted variables, which we use for profitability checks and which gets updated while hoisting is going on for a single loop. We do not need to refer to the information from other loops. Record separate postorder numbers for the old and new DFS since we need to use both simultaneously after loop unrolling. We will be able to get rid of this again soon. A small number of diffs are expected because the loop side effects computation is now more precise, since the old loop code includes some blocks in loops that are not actually part of the loop. For example, blocks that always throw can be in the lexical range and would previously cause the side effect computation to believe there was a memory havoc. Also, the side effect computation does some limited value tracking of assignment, which is more precise now since it is running in RPO instead of based on loop order before.
- Loading branch information