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

Optimization pass to improve performance of interpreters, and other recursive programs #138465

Copy link
Copy link
Open
@the-ssd

Description

@the-ssd
Issue body actions

Currently, LLVM generates an additional jump for interpreters, which could be inclined for better performance. (which is how interpreters written in Assembly like LuaJIT's interpreter work).

Example:

define i32 @example() {
dispatch:
   ; dispatch logic
   br {instruction}
instruction1:
   ; instruction logic
  br label %dispatch
instruction2:
   ; instruction logic
  br label %dispatch
}

But a faster version inlines logic from dispatch into instructions, and usually runs faster.

define i32 @example() {
   ; dispatch logic
   br {instruction}
instruction1:
   ; instruction logic
   ; dispatch logic
   br {instruction}
instruction2:
   ; instruction logic
   ; dispatch logic
   br {instruction}
}

But this is also a small optimization for a small amount of programs, and maybe better suited for a plugin.

Metadata

Metadata

Assignees

No one assigned

    Type

    No 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.