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

JIT assembly optimizer leaves some redundant branches #139757

Copy link
Copy link
@markshannon

Description

@markshannon
Issue body actions

For AArch64 emit__GUARD_IS_TRUE_POP produces the following assembly code:

...
14: 54000041 b.ne 0x1c <_JIT_ENTRY+0x1c>
18: 14000002 b 0x20 <_JIT_ENTRY+0x20>
1c: 14000000 b 0x1c <_JIT_ENTRY+0x1c>
000000000000001c: R_AARCH64_JUMP26 _JIT_JUMP_TARGET

but it should, ideally, emit this:

14: 54000041 b.ne 0x14 <_JIT_ENTRY+0x14>
000000000000001c: R_AARCH64_CONDBR19 _JIT_JUMP_TARGET

This doesn't seem to be an issue for x86, possibly due to the way Clang is setup for AArch64, possibly just an artefact of llvm's code gen.
Either way, rather than rely on llvm eliminating these jumps we can do it in the JIT builder's assembly optimizer.
Currently we don't perform jump fusion, but it would be easy enough to do so.

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-JITtype-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.