summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_analysis.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/optimizer_analysis.c')
-rw-r--r--Python/optimizer_analysis.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c
index 9fd4b19..0c95616 100644
--- a/Python/optimizer_analysis.c
+++ b/Python/optimizer_analysis.c
@@ -35,6 +35,7 @@
#ifdef Py_DEBUG
extern const char *_PyUOpName(int index);
+ extern void _PyUOpPrint(const _PyUOpInstruction *uop);
static const char *const DEBUG_ENV = "PYTHON_OPT_DEBUG";
static inline int get_lltrace(void) {
char *uop_debug = Py_GETENV(DEBUG_ENV);
@@ -377,14 +378,20 @@ optimize_uops(
_Py_UopsSymbol **stack_pointer = ctx->frame->stack_pointer;
- DPRINTF(3, "Abstract interpreting %s:%d ",
- _PyUOpName(opcode),
- oparg);
+#ifdef Py_DEBUG
+ if (get_lltrace() >= 3) {
+ printf("%4d abs: ", (int)(this_instr - trace));
+ _PyUOpPrint(this_instr);
+ printf(" ");
+ }
+#endif
+
switch (opcode) {
+
#include "optimizer_cases.c.h"
default:
- DPRINTF(1, "Unknown opcode in abstract interpreter\n");
+ DPRINTF(1, "\nUnknown opcode in abstract interpreter\n");
Py_UNREACHABLE();
}
assert(ctx->frame != NULL);
@@ -397,11 +404,13 @@ optimize_uops(
return 1;
out_of_space:
+ DPRINTF(3, "\n");
DPRINTF(1, "Out of space in abstract interpreter\n");
_Py_uop_abstractcontext_fini(ctx);
return 0;
error:
+ DPRINTF(3, "\n");
DPRINTF(1, "Encountered error in abstract interpreter\n");
_Py_uop_abstractcontext_fini(ctx);
return 0;
@@ -411,6 +420,7 @@ hit_bottom:
// This means that the abstract interpreter has hit unreachable code.
// We *could* generate an _EXIT_TRACE or _FATAL_ERROR here, but it's
// simpler to just admit failure and not create the executor.
+ DPRINTF(3, "\n");
DPRINTF(1, "Hit bottom in abstract interpreter\n");
_Py_uop_abstractcontext_fini(ctx);
return 0;