The original name is just too much of a mouthful.
Python/Python-ast.c generated
Python/executor_cases.c.h generated
Python/generated_cases.c.h generated
-Python/tier2_redundancy_eliminator_cases.c.h generated
+Python/optimizer_cases.c.h generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
Python/bytecodes.c @markshannon @gvanrossum
Python/optimizer*.c @markshannon @gvanrossum
Python/optimizer_analysis.c @Fidget-Spinner
-Python/tier2_redundancy_eliminator_bytecodes.c @Fidget-Spinner
+Python/optimizer_bytecodes.c @Fidget-Spinner
Lib/test/test_patma.py @brandtbucher
Lib/test/test_type_*.py @JelleZijlstra
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
- '**jit**'
- 'Python/bytecodes.c'
- 'Python/optimizer*.c'
- - 'Python/tier2_redundancy_eliminator_bytecodes.c'
+ - 'Python/optimizer_bytecodes.c'
push:
paths:
- '**jit**'
- 'Python/bytecodes.c'
- 'Python/optimizer*.c'
- - 'Python/tier2_redundancy_eliminator_bytecodes.c'
+ - 'Python/optimizer_bytecodes.c'
workflow_dispatch:
concurrency:
import parser
from stack import Stack
import tier1_generator
- import tier2_abstract_generator
+ import optimizer_generator
def handle_stderr():
temp_input.flush()
with handle_stderr():
- tier2_abstract_generator.generate_tier2_abstract_from_files(
+ optimizer_generator.generate_tier2_abstract_from_files(
[self.temp_input_filename, self.temp_input2_filename],
self.temp_output_filename
)
-o $(srcdir)/Python/generated_cases.c.h.new $(srcdir)/Python/bytecodes.c
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/tier2_generator.py \
-o $(srcdir)/Python/executor_cases.c.h.new $(srcdir)/Python/bytecodes.c
- $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/tier2_abstract_generator.py \
- -o $(srcdir)/Python/tier2_redundancy_eliminator_cases.c.h.new \
- $(srcdir)/Python/tier2_redundancy_eliminator_bytecodes.c \
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/optimizer_generator.py \
+ -o $(srcdir)/Python/optimizer_cases.c.h.new \
+ $(srcdir)/Python/optimizer_bytecodes.c \
$(srcdir)/Python/bytecodes.c
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/opcode_metadata_generator.py \
-o $(srcdir)/Include/internal/pycore_opcode_metadata.h.new $(srcdir)/Python/bytecodes.c
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode_metadata.h $(srcdir)/Include/internal/pycore_opcode_metadata.h.new
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_uop_metadata.h $(srcdir)/Include/internal/pycore_uop_metadata.h.new
$(UPDATE_FILE) $(srcdir)/Python/executor_cases.c.h $(srcdir)/Python/executor_cases.c.h.new
- $(UPDATE_FILE) $(srcdir)/Python/tier2_redundancy_eliminator_cases.c.h $(srcdir)/Python/tier2_redundancy_eliminator_cases.c.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/optimizer_cases.c.h $(srcdir)/Python/optimizer_cases.c.h.new
$(UPDATE_FILE) $(srcdir)/Lib/_opcode_metadata.py $(srcdir)/Lib/_opcode_metadata.py.new
Python/compile.o: $(srcdir)/Include/internal/pycore_opcode_metadata.h
Python/optimizer_analysis.o: \
$(srcdir)/Include/internal/pycore_opcode_metadata.h \
$(srcdir)/Include/internal/pycore_optimizer.h \
- $(srcdir)/Python/tier2_redundancy_eliminator_cases.c.h
+ $(srcdir)/Python/optimizer_cases.c.h
Python/frozen.o: $(FROZEN_FILES_OUT)
<!-- Taken from _Target._compute_digest in Tools\jit\_targets.py: -->
<_JITSources Include="$(PySourcePath)Python\executor_cases.c.h;$(GeneratedPyConfigDir)pyconfig.h;$(PySourcePath)Tools\jit\**"/>
<_JITOutputs Include="$(GeneratedPyConfigDir)jit_stencils.h"/>
- <_CasesSources Include="$(PySourcePath)Python\bytecodes.c;$(PySourcePath)Python\tier2_redundancy_eliminator_bytecodes.c;"/>
- <_CasesOutputs Include="$(PySourcePath)Python\generated_cases.c.h;$(PySourcePath)Include\opcode_ids.h;$(PySourcePath)Include\internal\pycore_uop_ids.h;$(PySourcePath)Python\opcode_targets.h;$(PySourcePath)Include\internal\pycore_opcode_metadata.h;$(PySourcePath)Include\internal\pycore_uop_metadata.h;$(PySourcePath)Python\tier2_redundancy_eliminator_cases.c.h;$(PySourcePath)Lib\_opcode_metadata.py"/>
+ <_CasesSources Include="$(PySourcePath)Python\bytecodes.c;$(PySourcePath)Python\optimizer_bytecodes.c;"/>
+ <_CasesOutputs Include="$(PySourcePath)Python\generated_cases.c.h;$(PySourcePath)Include\opcode_ids.h;$(PySourcePath)Include\internal\pycore_uop_ids.h;$(PySourcePath)Python\opcode_targets.h;$(PySourcePath)Include\internal\pycore_opcode_metadata.h;$(PySourcePath)Include\internal\pycore_uop_metadata.h;$(PySourcePath)Python\optimizer_cases.c.h;$(PySourcePath)Lib\_opcode_metadata.py"/>
</ItemGroup>
<Target Name="_TouchRegenSources" Condition="$(ForceRegen) == 'true'">
WorkingDirectory="$(PySourcePath)" />
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\tier2_generator.py $(PySourcePath)Python\bytecodes.c"
WorkingDirectory="$(PySourcePath)" />
- <Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\tier2_abstract_generator.py $(PySourcePath)Python\tier2_redundancy_eliminator_bytecodes.c $(PySourcePath)Python\bytecodes.c"
+ <Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\optimizer_generator.py $(PySourcePath)Python\optimizer_bytecodes.c $(PySourcePath)Python\bytecodes.c"
WorkingDirectory="$(PySourcePath)" />
<Exec Command="$(PythonForBuild) $(PySourcePath)Tools\cases_generator\opcode_metadata_generator.py $(PySourcePath)Python\bytecodes.c"
WorkingDirectory="$(PySourcePath)" />
/*
- * This file contains the support code for CPython's uops redundancy eliminator.
+ * This file contains the support code for CPython's uops optimizer.
* It also performs some simple optimizations.
* It performs a traditional data-flow analysis[1] over the trace of uops.
* Using the information gained, it chooses to emit, or skip certain instructions
/* 1 for success, 0 for not ready, cannot error at the moment. */
static int
-uop_redundancy_eliminator(
+optimize_uops(
PyCodeObject *co,
_PyUOpInstruction *trace,
int trace_len,
_PyUOpName(opcode),
oparg);
switch (opcode) {
-#include "tier2_redundancy_eliminator_cases.c.h"
+#include "optimizer_cases.c.h"
default:
DPRINTF(1, "Unknown opcode in abstract interpreter\n");
char *uop_optimize = Py_GETENV("PYTHONUOPSOPTIMIZE");
if (uop_optimize != NULL && *uop_optimize > '0') {
- err = uop_redundancy_eliminator(
+ err = optimize_uops(
(PyCodeObject *)frame->f_executable, buffer,
buffer_size, curr_stacklen, dependencies);
}
-// This file is generated by Tools/cases_generator/tier2_abstract_generator.py
+// This file is generated by Tools/cases_generator/optimizer_generator.py
// from:
-// Python/tier2_redundancy_eliminator_bytecodes.c
+// Python/optimizer_bytecodes.c
// Do not edit!
case _NOP: {
Python/frozen_modules/*.h
Python/generated_cases.c.h
Python/executor_cases.c.h
-Python/tier2_redundancy_eliminator_cases.c.h
+Python/optimizer_cases.c.h
# not actually source
Python/bytecodes.c
-Python/tier2_redundancy_eliminator_bytecodes.c
+Python/optimizer_bytecodes.c
# mimalloc
Objects/mimalloc/*.c
- `parser.py` helper for interactions with `parsing.py`
- `tierN_generator.py`: a couple of driver scripts to read `Python/bytecodes.c` and
write `Python/generated_cases.c.h` (and several other files)
-- `tier2_abstract_generator.py`: reads `Python/bytecodes.c` and
- `Python/tier2_redundancy_eliminator_bytecodes.c` and writes
- `Python/tier2_redundancy_eliminator_cases.c.h`
+- `optimizer_generator.py`: reads `Python/bytecodes.c` and
+ `Python/optimizer_bytecodes.c` and writes
+ `Python/optimizer_cases.c.h`
- `stack.py`: code to handle generalized stack effects
- `cwriter.py`: code which understands tokens and how to format C code;
main class: `CWriter`
-"""Generate the cases for the tier 2 redundancy eliminator/abstract interpreter.
-Reads the instruction definitions from bytecodes.c. and tier2_redundancy_eliminator.bytecodes.c
-Writes the cases to tier2_redundancy_eliminator_cases.c.h, which is #included in Python/optimizer_analysis.c.
+"""Generate the cases for the tier 2 optimizer.
+Reads the instruction definitions from bytecodes.c and optimizer_bytecodes.c
+Writes the cases to optimizer_cases.c.h, which is #included in Python/optimizer_analysis.c.
"""
import argparse
from lexer import Token
from stack import StackOffset, Stack, SizeMismatch, UNUSED
-DEFAULT_OUTPUT = ROOT / "Python/tier2_redundancy_eliminator_cases.c.h"
-DEFAULT_ABSTRACT_INPUT = ROOT / "Python/tier2_redundancy_eliminator_bytecodes.c"
+DEFAULT_OUTPUT = ROOT / "Python/optimizer_cases.c.h"
+DEFAULT_ABSTRACT_INPUT = ROOT / "Python/optimizer_bytecodes.c"
def validate_uop(override: Uop, uop: Uop) -> None: