Skip to content

Get rid of conditional inputs and outputs for instructions in bytecodes.c #716

@markshannon

Description

@markshannon

Conditional inputs and outputs of the form arg if (oparg &1) are used in a few instructions in bytecodes.c

They have the advantage of reducing the size of bytecodes and the number of instructions executed, but they add conditional code to the instruction bodies. They also complicate the code generators quite a lot, requiring extra logic to split the uops in the jit and special handling in the interpreter generator.

I'm wondering if inefficiencies due to the additional complexity might equal or outweigh the efficiency of the reduced instruction count.
Even if it does not yet, I expect that it might when we add top of stack caching as irregular stack depths complicates code generation even more.

From a maintenance perspective, even if it introduced a small slow down, removing conditional inputs and outputs would probably be worth it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions