Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove duplicate uops _LOAD_CONST_UNDER_INLINE(_BORROW) in JIT #148235

Copy link
Copy link
@NekoAsakura

Description

@NekoAsakura
Issue body actions

Feature or enhancement

Proposal:

_INSERT_1_LOAD_CONST_INLINE(_BORROW) and _LOAD_CONST_UNDER_INLINE(_BORROW) have identical stack effects — they're basically the same thing with different names.

cpython/Python/bytecodes.c

Lines 5927 to 5937 in 0b20bff

tier2 op(_INSERT_1_LOAD_CONST_INLINE, (ptr/4, left -- res, l)) {
res = PyStackRef_FromPyObjectNew(ptr);
l = left;
INPUTS_DEAD();
}
tier2 op(_INSERT_1_LOAD_CONST_INLINE_BORROW, (ptr/4, left -- res, l)) {
res = PyStackRef_FromPyObjectBorrow(ptr);
l = left;
INPUTS_DEAD();
}

cpython/Python/bytecodes.c

Lines 5968 to 5978 in 0b20bff

tier2 op(_LOAD_CONST_UNDER_INLINE, (ptr/4, old -- value, new)) {
new = old;
DEAD(old);
value = PyStackRef_FromPyObjectNew(ptr);
}
tier2 op(_LOAD_CONST_UNDER_INLINE_BORROW, (ptr/4, old -- value, new)) {
new = old;
DEAD(old);
value = PyStackRef_FromPyObjectBorrow(ptr);
}

_LOAD_CONST_UNDER_INLINE(_BORROW) already has entries in op_without_push, so remove_unneeded_uops can properly simplify it. However _INSERT_1 don't, thus we should rename all _INSERT_1 usages to _LOAD_CONST_UNDER and remove the duplicate definitions.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

#148230 (comment)

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.