-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-107557: Setup abstract interpretation #107847
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 44 commits
d20fbb8
2aeea51
1a728ab
17fccbc
a1da69d
b458e17
f81f888
0020320
1f93072
dac63e3
e62e015
a7f654c
f4040b8
ec58145
4292767
fdcca90
5110fb9
9f443a2
7632ed1
0d0c4c4
4c8953e
3bd36fa
229097f
ca0fab7
68c684f
46c5777
b839ee4
6ecf3d2
b6eeb25
d5cceb9
8c0d65f
95db909
1e05ef8
d7d8b52
4d7abc7
3d76f9a
e81def2
9a5a3f7
df490d0
1e4fc94
6de77a7
a11fc80
c61015b
56c62eb
3c08ebe
d5f16be
1e61c49
6c24b49
2be404d
29e255d
3c44117
b758b47
80c7f18
6a2b204
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef Py_INTERNAL_OPTIMIZER_H | ||
#define Py_INTERNAL_OPTIMIZER_H | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifndef Py_BUILD_CORE | ||
# error "this header requires Py_BUILD_CORE define" | ||
#endif | ||
|
||
#include "pycore_uops.h" | ||
|
||
int _Py_uop_analyze_and_optimize(PyCodeObject *code, | ||
_PyUOpInstruction *trace, int trace_len, int curr_stackentries); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif /* !Py_INTERNAL_OPTIMIZER_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,11 @@ extern "C" { | |
# error "this header requires Py_BUILD_CORE define" | ||
#endif | ||
|
||
#define _Py_UOP_MAX_TRACE_LENGTH 32 | ||
#define _Py_UOP_MAX_TRACE_LENGTH 256 | ||
|
||
typedef struct { | ||
uint32_t opcode; | ||
uint32_t oparg; | ||
int32_t opcode; | ||
int32_t oparg; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious about this change. Are you using negative opcodes or opargs? IIUC oparg really is treated as a 32-bit unsigned int in ceval.c and bytecodes.c. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm using both negative ints and opargs, but only during the analysis phase. They are converted back to unsigned after the last pass. For all intents and purposes outside of the optimizer pass, they can be treated as unsigned. |
||
uint64_t operand; // A cache entry | ||
} _PyUOpInstruction; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.