Skip to content
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

generic and more efficient removal of unreachable code #45264

Closed
doublep mannequin opened this issue Jul 31, 2007 · 2 comments
Closed

generic and more efficient removal of unreachable code #45264

doublep mannequin opened this issue Jul 31, 2007 · 2 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@doublep
Copy link
Mannequin

doublep mannequin commented Jul 31, 2007

BPO 1764986
Nosy @rhettinger
Files
  • unreachable-code.diff: patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2008-05-31.04:59:27.344>
    created_at = <Date 2007-07-31.22:44:17.000>
    labels = ['interpreter-core']
    title = 'generic and more efficient removal of unreachable code'
    updated_at = <Date 2008-05-31.04:59:27.154>
    user = 'https://bugs.python.org/doublep'

    bugs.python.org fields:

    activity = <Date 2008-05-31.04:59:27.154>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2008-05-31.04:59:27.344>
    closer = 'rhettinger'
    components = ['Interpreter Core']
    creation = <Date 2007-07-31.22:44:17.000>
    creator = 'doublep'
    dependencies = []
    files = ['8146']
    hgrepos = []
    issue_num = 1764986
    keywords = ['patch']
    message_count = 2.0
    messages = ['52972', '67565']
    nosy_count = 2.0
    nosy_names = ['rhettinger', 'doublep']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1764986'
    versions = ['Python 2.6']

    @doublep
    Copy link
    Mannequin Author

    doublep mannequin commented Jul 31, 2007

    The attached patch removed unreachable code after RAISE_VARARGS, BREAK_LOOP and RETURN_VALUE in generic way (no more tests for LOAD_CONST None RETURN_VALUE, etc.)

    It is possible to generalize it more for some other bytecodes. The only problem they are already used in switch() in question as labels. Probably not important enough to warrant another switch() or break this out into a function/macro.

    No speedup is expected, but I think the patch is good with no drawbacks anyway.

    @doublep doublep mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jul 31, 2007
    @rhettinger
    Copy link
    Contributor

    Not too excited about this. It adds to compilation time but doesn't
    save any runtime. It's not at all common for production code to have
    unreachable code at RAISE_VARARGS or BREAK_LOOP, so I see no reason to
    complexify to the peepholer to handle this case.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant