Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-114058: The Tier2 Optimizer#114059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-SpinnerFidget-Spinner commentedJan 14, 2024
edited
Loading

Closes#114058

This PR turns on the optimizer for all uops. The tier 2 uops optimizer contains a few parts: the abstract interpreter, the IR, and the codegen.

The abstract interpreter does the following:

  • Value numbering for types (not on all expressions though, that is too expensive)
  • Type propagation
  • Constant propagation
  • Guard elimination
  • Poor man's loop invariant code motion for guards/loop duplication

Function inlining is left out for a future PR, as it's the most complex.

After analysis of the bytecode and doing all of the above, it emits optimized uops, and passes that to the executor.

When uops is enabled, **this passes the entire CPython test suite **. The significant milestone is that this is able to analyse and abstract interpret all CPython uops that we currently support. The other significant milestone is that this generates code that passes CPython's test suite.

Refleak tests will fail as well, as they need a design overhaul.

The design of this PR is herehttps://github.com/Fidget-Spinner/cpython_optimization_notes/blob/main/3.13/uops_optimizer.md

High level discussion herefaster-cpython/ideas#648.

0-2% faster on Linux, 3% faster on macOS ARM64

bluss reacted with hooray emojierlend-aasland reacted with eyes emoji
@Fidget-SpinnerFidget-Spinner marked this pull request as draftJanuary 14, 2024 18:38
@Fidget-SpinnerFidget-Spinner changed the titleThe Tier2 Optimizer's abstract interpretergh-114058: The Tier2 Optimizer's abstract interpreterJan 14, 2024
@Fidget-Spinner
Copy link
MemberAuthor

Please give me some time to write out the proper docs explaining the abstract IR this uses.

@Fidget-SpinnerFidget-Spinner changed the titlegh-114058: The Tier2 Optimizer's abstract interpretergh-114058: The Tier2 OptimizerJan 14, 2024
@Fidget-Spinner
Copy link
MemberAuthor

All tests run with uops on now passes except for the following two:

  1. test_capi - there's one test that counts memory allocation, which obviously fails because my optimizer allocates memory. I think I'm just going to skip this test when -Xuops is detected.
  2. test_ctypes - this doesn't actually fail I just have no clue whether it passes because the linker on my system is broken.

@brandtbucherbrandtbucher self-requested a reviewJanuary 16, 2024 21:27
@brandtbucher
Copy link
Member

I think I'm just going to skip this test when -Xuops is detected.

Maybe we should just fix the test? This sort of seems to be kicking the can down the road, since eventually tier 2 will be on by default.

There's awithout_optimizer helper intest.support. We also have other ways of getting and setting optimizers in_testinternalcapi if we're in a subprocess or something (check outtest_opt.temporary_optimizer for an example).

@brandtbucher
Copy link
Member

1% slower on macOS (other platforms aren't building right now). 8% reduction in traces executed, but3%increase in uops executed.

PGO failure on Windows:

Details
Running PGInstrument|x64 interpreter...Using random seed: 12566781720:00:00 Run 44 tests sequentially0:00:00 [ 1/44] test_array0:00:05 [ 2/44] test_base640:00:07 load avg: 0.41 [ 3/44] test_binascii0:00:07 load avg: 0.41 [ 4/44] test_binop0:00:08 load avg: 0.41 [ 5/44] test_bisect0:00:08 load avg: 0.42 [ 6/44] test_bytes0:00:34 load avg: 0.50 [ 7/44] test_bz20:00:40 load avg: 0.49 [ 8/44] test_cmath0:00:41 load avg: 0.48 [ 9/44] test_codecs0:00:52 load avg: 0.46 [10/44] test_collections0:01:03 load avg: 0.52 [11/44] test_complex0:01:04 load avg: 0.53 [12/44] test_dataclasses0:01:08 load avg: 0.56 [13/44] test_datetime0:01:18 load avg: 0.56 [14/44] test_decimal0:01:49 load avg: 0.61 [15/44] test_difflib -- test_decimal passed in 31.4 sec0:01:59 load avg: 0.60 [16/44] test_embed0:02:42 load avg: 0.33 [17/44] test_float -- test_embed passed in 42.7 sec0:02:43 load avg: 0.34 [18/44] test_fstring0:02:57 load avg: 0.34 [19/44] test_functoolsWindows fatal exception: stack overflowThread 0x00002f90 (most recent call first):  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\libregrtest\win_utils.py", line 43 in _update_loadCurrent thread 0x000019dc (most recent call first):  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1[875](https://github.com/faster-cpython/benchmarking/actions/runs/7559538614/job/20583550792#step:10:876) in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  File "C:\actions-runner\_work\benchmarking\benchmarking\cpython\Lib\test\test_functools.py", line 1875 in fib  ...

PGO failure on Linux:

Details
# Next, run the profile task to generate the profile information../python -m test --pgo --timeout=Using random seed: [1366](https://github.com/faster-cpython/benchmarking/actions/runs/7559538614/job/20583550197#step:10:1367)[1376](https://github.com/faster-cpython/benchmarking/actions/runs/7559538614/job/20583550197#step:10:1377)730:00:00 load avg: 1.96 Run 44 tests sequentially0:00:00 load avg: 1.96 [ 1/44] test_array0:00:00 load avg: 1.89 [ 2/44] test_base640:00:01 load avg: 1.89 [ 3/44] test_binascii0:00:01 load avg: 1.89 [ 4/44] test_binop0:00:01 load avg: 1.89 [ 5/44] test_bisect0:00:01 load avg: 1.89 [ 6/44] test_bytes0:00:05 load avg: 1.89 [ 7/44] test_bz20:00:06 load avg: 1.82 [ 8/44] test_cmath0:00:06 load avg: 1.82 [ 9/44] test_codecsFatal Python error: Segmentation faultCurrent thread 0x00007fb926b78740 (most recent call first):  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/encodings/idna.py", line 37 in nameprep  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/encodings/idna.py", line 74 in ToASCII  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/encodings/idna.py", line 142 in ToUnicode  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/encodings/idna.py", line 222 in decode  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/test_codecs.py", line 1561 in test_builtin_decode_length_limit  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/case.py", line 589 in _callTestMethod  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/case.py", line 636 in run  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/case.py", line 692 in __call__  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/suite.py", line 122 in run  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/suite.py", line 84 in __call__  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/suite.py", line 122 in run  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/unittest/suite.py", line 84 in __call__  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/testresult.py", line 146 in run  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 57 in _run_suite  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 37 in run_unittest  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 132 in test_func  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 88 in regrtest_runner  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 135 in _load_run_test  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 178 in _runtest_env_changed_exc  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 278 in _runtest  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/single.py", line 306 in run_single_test  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/main.py", line 302 in run_test  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/main.py", line 336 in run_tests_sequentially  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/main.py", line 477 in _run_tests  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/main.py", line 509 in run_tests  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/main.py", line 672 in main  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/libregrtest/main.py", line 680 in main  File "/home/ddfun/actions-runner/_work/benchmarking/benchmarking/cpython/Lib/test/__main__.py", line 2 in <module>  File "<frozen runpy>", line 88 in _run_code  File "<frozen runpy>", line 198 in _run_module_as_mainExtension modules: _testcapi, _testinternalcapi (total: 2)Segmentation fault (core dumped)

Both look like recursion-related issues. The Windows onemay be fixed onmain as of yesterday.

@Fidget-Spinner
Copy link
MemberAuthor

Thanks Brandt. Seems like the slowdown is due tobm_nbody, and there's some serious pessimization there for some reason. The only way such a massive slowdown could happen IMO, is if the executors are constantly being discarded and re-optimized again, since optimization is now not completely free (not too sure, will take a look).

Llike Mark said though, benchmark results aren't too important at the moment. Function inlining would be the most important optimization and that's missing from this PR, to be added in a future PR.

@gvanrossum
Copy link
Member

Nevertheless it would be wise to dig deeper into what goes on with bm_nbody. It may be an important canary. :-)

Copy link
Member

@gvanrossumgvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Here are some comments on the latest version which I (mostly) wrote before hearing about plans to merge with Mark's version. (I wonder if it might make sense to start a new PR for that, rather than carry the history of over 100 commits along?)

Comment on lines +131 to +135
ifvar.name!=MANGLED_NULL:
out.emit(f"{var.name} = sym_init_unknown(ctx);\n")
out.emit(f"if({var.name} == NULL) goto error;\n")
ifvar.type_prop:
out.emit(f"sym_set_type({var.name},{var.type_prop[0]}, 0);\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is an example of something that I think can be streamlined further. Instead of callingsym_init_unknown(ctx) followed bysym_set_type(...) there ought to be a single function you can call to create a symbol with a given type. Basically a bunch of convenience constructors.

Comment on lines +15 to +16
// This the above + additional working space we need.
#defineUOP_MAX_TRACE_WORKING_LENGTH (UOP_MAX_TRACE_LENGTH * 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't see this used in the code any more.

Comment on lines +381 to +389
sym_set_type(sym,GUARD_TYPE_VERSION_TYPE,tp->tp_version_tag);
}
if (tp->tp_flags&Py_TPFLAGS_MANAGED_DICT) {
PyDictOrValuesdorv=*_PyObject_DictOrValuesPointer(obj);
if(_PyDictOrValues_IsValues(dorv)) {
sym_set_type(sym,GUARD_DORV_VALUES_TYPE,0);
}
}
if (tp==&PyLong_Type) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This could also use a longer explanation. What special cases are these twoif blocks covering?

@Fidget-Spinner
Copy link
MemberAuthor

Here are some comments on the latest version which I (mostly) wrote before hearing about plans to merge with Mark's version. (I wonder if it might make sense to start a new PR for that, rather than carry the history of over 100 commits along?)

Makes sense. I will close this PR and create a new one with the Mark's new DSL changes. Thanks for all your reviews!

@Fidget-Spinner
Copy link
MemberAuthor

The successor PR with cleaned up history is at#115085.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gvanrossumgvanrossumgvanrossum left review comments

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@brandtbucherbrandtbucherAwaiting requested review from brandtbucherbrandtbucher is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Tier 2 optimizer's abstract interpreter

5 participants

@Fidget-Spinner@brandtbucher@gvanrossum@bedevere-bot@markshannon

[8]ページ先頭

©2009-2025 Movatter.jp