You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Always create loop pre-header
As part of finding natural loops and creating the loop
table, create a loop pre-header for every loop. This
simplifies a lot of downstream phases, as the loop
pre-header will be guaranteed to exist, and will already
exist in the dominator tree.
Introduce code to preserve an empty pre-header block through
the optimization phases.
Remove now unnecessary code in hoisting and elsewhere.
Fixes#77033, #62665
* Fix loop unrolling to work with loop pre-headers
* Add `optLoopsRequirePreHeaders` variable
* Prevent removing pre-header blocks
* Allow removing unreachable pre-headers
Disallow creating pre-header after SSA is built
* Make optLoopCloningEnabled() static
* Teach loop cloning to expect and respect loop pre-headers
* Remove special case pre-header handling in hoisting
* Remove unused SSA update code in fgCreateLoopPreHeader
* Remove unneeded pre-header code from fgDominate
* Remove workaround to avoid extraneous LSRA diffs due to bbNum ordering
* Update comments
* Improve loop table rebuilding with pre-headers
When the loop table is built, it looks around for various loop patterns,
including looking for a guaranteed-executed, pre-loop constant initializer.
This is used in loop cloning and loop unrolling. It needs to look
"a little harder" in the case we created loop pre-headers, then
rebuild the loop table (currently, only due to loop unrolling of loops that
contain nested loops). The new code only allows for empty pre-headers. This
works since in our current phase ordering, no hoisting happens by the time
the loop table is rebuilt.
(Actually, it's currently not necessary to do this at all, since the constant
initializer info is only used by cloning and loop unrolling, both of which
have finished by the time the loop table is rebuilt. However, we might someday
choose to rebuild the loop table after cloning and before unrolling, at which
point it would be necessary.)
* Update comments
0 commit comments