Issue 138465
Summary Optimization pass to improve performance of interpreters, and other recursive programs
Labels new issue
Assignees
Reporter the-ssd
    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:
```llvm
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.
```llvm
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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to