gh-120953: Add UOp Paircounts to JIT when Built with PyStats #120954
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, uop pairs are only counted in a PyStats build when it is build with just the Tier 2 interpreter without the JIT. This PR adds uop pair counting when running with the JIT, by adding an additional
last_uopfield to the_PyExecutorObjectstruct.It also adds a new
--pystatsflag toTools/jit/build.py. This enables/disables the lines which cause the executor to track its last uop, since there's no point in doing so if we're not tracking pystats. This flag is included in the hash that is used to determine whether the jit stencils need to be rebuilt, so that pystats stencils are not accidently used in a non-pystats build and vice-versa.The performance of this could potentially be improved by using a local variable inside
_PyJIT_Compileto track the last uop, and emit that into the stencils directly?