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
{{ message }}
Repository navigation
Consider hoisting of class init checks for loop cloning and inversion #49102
Cloning to allow for a loop with a class init check, and one where the class init check is removed, could be profitable.
AndyAyersMS writes:
I wonder if we should consider using this check as a gating condition for loop cloning... Also may factor into the do-while transformation heuristics, these try to account for the potential "savings" from hoisting the class init call check out of the loop.
So for some subset of loops we would produce a loop that knows classes are inited and does no checks, and another that will conditionally check within the loop body as above.
Yeah, that's the idea, where slow-loop is required to have an in-loop init check, and fast-loop can remove it. It wouldn't be valuable if the init check can already be hoisted.
Activity
EgorBo commentedon Mar 4, 2021
What is going to happen for, let's say:
Here we already are going to clone the loop for Length>=1000 check. Will it look like this then?:
BruceForstall commentedon Mar 4, 2021
Yeah, that's the idea, where slow-loop is required to have an in-loop init check, and fast-loop can remove it. It wouldn't be valuable if the init check can already be hoisted.