Skip to content

Commit 00c81fa

Browse files
revert last 2 changes
1 parent d820e22 commit 00c81fa

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

Python/optimizer.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -710,19 +710,11 @@ _PyJIT_translate_single_bytecode_to_trace(
710710
case POP_JUMP_IF_FALSE:
711711
case POP_JUMP_IF_TRUE:
712712
{
713-
int counter = target_instr[1].cache;
714-
int bitcount = _Py_popcount32(counter);
715-
int jump_likely = bitcount > 8;
716713
_Py_CODEUNIT *computed_next_instr_without_modifiers = target_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
717714
_Py_CODEUNIT *computed_next_instr = computed_next_instr_without_modifiers + (computed_next_instr_without_modifiers->op.code == NOT_TAKEN);
718715
_Py_CODEUNIT *computed_jump_instr = computed_next_instr_without_modifiers + oparg;
719716
assert(next_instr == computed_next_instr || next_instr == computed_jump_instr);
720717
int jump_happened = computed_jump_instr == next_instr;
721-
// Jump is likely but it did not happen this time. Indicates we are likely tracing
722-
// an uncommmon path. Stop the trace early here to prevent trace explosion.
723-
if (jump_likely != jump_happened) {
724-
goto unsupported;
725-
}
726718
uint32_t uopcode = BRANCH_TO_GUARD[opcode - POP_JUMP_IF_FALSE][jump_happened];
727719
ADD_TO_TRACE(uopcode, 0, 0, INSTR_IP(jump_happened ? computed_next_instr : computed_jump_instr, old_code));
728720
break;
@@ -1234,7 +1226,7 @@ uop_optimize(
12341226
int curr_stackentries = tstate->interp->jit_state.jit_tracer_initial_stack_depth;
12351227
int length = interp->jit_state.jit_tracer_code_curr_size;
12361228
// Trace too short, don't bother.
1237-
if (length <= 20 && buffer[length-1].opcode != _JUMP_TO_TOP) {
1229+
if (length <= 5) {
12381230
return 0;
12391231
}
12401232
assert(length > 0);

Python/optimizer_analysis.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,10 @@ _Py_uop_analyze_and_optimize(
528528
{
529529
OPT_STAT_INC(optimizer_attempts);
530530

531-
int err = optimize_uops(
531+
optimize_uops(
532532
initial_func, buffer,
533533
length, curr_stacklen, dependencies);
534534

535-
if (err == 0) {
536-
return err;
537-
}
538-
539535
assert(length > 0);
540536

541537
length = remove_unneeded_uops(buffer, length);

0 commit comments

Comments
 (0)