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
Jump-To-Jump elimination could be more aggressive. #93223
I tried something like this a few months ago, but (if I remember correctly) it ended up duplicating a few blocks in test_dis.py. The net effect was more code, not less, and it ended up actually having the same number of jumps in the final output for all code paths (because some paths had to jump over the new blocks now, I think).
I abandoned that experiment because I couldn’t determine the cause of the duplication. I wonder if that’s still the case (or if @iritkatriel knows what the problem might be).
As a more concrete example, this is the difference in bm_hexiom dis outputs before and after the change. 28 occurrences of >>\s+\d+\s+JUMP goes down to just 6, and all of these remaining 6 are FOR_ITER --> JUMP_BACKWARD, which we can't fold for now.
Activity
brandtbucher commentedon May 25, 2022
I tried something like this a few months ago, but (if I remember correctly) it ended up duplicating a few blocks in
test_dis.py. The net effect was more code, not less, and it ended up actually having the same number of jumps in the final output for all code paths (because some paths had to jump over the new blocks now, I think).I abandoned that experiment because I couldn’t determine the cause of the duplication. I wonder if that’s still the case (or if @iritkatriel knows what the problem might be).
brandtbucher commentedon May 25, 2022
(At any rate, I think my experience highlights just how opaque and complex the interactions between the different compiler passes are.)
sweeneyde commentedon May 25, 2022
Maybe something has changed between then and now, but that change now makes
jumpyone instruction shorter and eliminates two jump-to-jumps.#93229
sweeneyde commentedon May 26, 2022
These are apparently the sites in pyperformance that this applies to:
Details
As a more concrete example, this is the difference in bm_hexiom dis outputs before and after the change. 28 occurrences of
>>\s+\d+\s+JUMPgoes down to just 6, and all of these remaining 6 areFOR_ITER --> JUMP_BACKWARD, which we can't fold for now.gh-93223: More aggressive Jump-To-Jump elimination (GH-93229)