-
Notifications
You must be signed in to change notification settings - Fork 96
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
Introduce baseline JIT compiler #135
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve the issues raised by CodeQL in advance.
block_map_t block_map; /**< basic block map */ | ||
#else | ||
struct cache *cache; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To minimize the code changes, is it possible to stick to block_map_t
rather than struct cache
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is difficult to stick to block_map_t
, because the structure of ARC cache is totally different from block_map_t
.
8970c95
to
881ac43
Compare
216c4bb
to
212c470
Compare
The proposed changes aim to achieve the following objectives:
These refinements focus on improving code organization and minimizing duplication. By reusing the existing RV32 interpreter implementation, we can expedite the development of the JIT compiler while maintaining consistency between the interpreter and JIT modes of execution. The new branch Assuming the existence of a dedicated shell script capable of generating C-string operations for each
This pull request should be on top of branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase latest wip/jit
branch rather than master
branch.
24354c0
to
c2c72fb
Compare
It fails to build on macOS: $ make
Makefile:19: *** missing separator. Stop. System information:
|
The baseline JIT compiler design involves tracing an EBB when its usage frequency exceeds a predetermined threshold. We then utilize a code generator to convert the instruction sequence into C code. The C code is subsequently compiled using mir, and the resulting target machine code is stored in the code cache for future utilization. The primary objective of introducing the baseline JIT compiler is to enhance the execution speed of RISC-V instructions with minimal modification. This implementation requires three additional components: a code generator, mir compiler, and code cache, while maintaining the original design of the interpreter. Furthermore, this baseline JIT compiler serves as the foundational target for future improvements. | Metric | master | baseline JIT |Speedup | |-----------+-------------------------+--------------------------+--------| | CoreMark |1352.843 (Iterations/Sec)|1740.881 (Iterations/Sec) | +28.6% | | dhrystone |1146 DMIPS |2368.33 DMIPS | +106% |
Solved |
Runtime failure on macOS/Arm64. Reproduce: $ git clone https://github.com/sysprog21/rv32emu
$ cd rv32emu
$ gh pr checkout 135
$ make ENABLE_JIT=1
$ make check Error messages:
|
This preliminary work was integrated into |
The baseline JIT compiler design involves tracing an EBB when its usage frequency exceeds a predetermined threshold. We then utilize a code generator to convert the instruction sequence into C code. The C code is subsequently compiled using MIR, and the resulting target machine code is stored in the code cache for future utilization. The primary objective of introducing the baseline JIT compiler is to enhance the execution speed of RISC-V instructions with minimal modification. This implementation requires three additional components: a code generator, MIR compiler, and code cache, while maintaining the original design of the interpreter. Furthermore, this baseline JIT compiler serves as the foundational target for future improvements. | Metric | master | baseline JIT |Speedup | |-----------+-------------------------+--------------------------+--------| | CoreMark |1352.843 (Iterations/Sec)|1740.881 (Iterations/Sec) | +28.6% | | dhrystone |1146 DMIPS |2368.33 DMIPS | +106% | Known issue: this implementation does not work on Arm64 architecture.
The baseline JIT compiler design involves tracing an EBB when its usage frequency exceeds a predetermined threshold. We then utilize a code generator to convert the instruction sequence into C code. The C code is subsequently compiled using MIR, and the resulting target machine code is stored in the code cache for future utilization. The primary objective of introducing the baseline JIT compiler is to enhance the execution speed of RISC-V instructions with minimal modification. This implementation requires three additional components: a code generator, MIR compiler, and code cache, while maintaining the original design of the interpreter. Furthermore, this baseline JIT compiler serves as the foundational target for future improvements. | Metric | master | baseline JIT |Speedup | |-----------+-------------------------+--------------------------+--------| | CoreMark |1352.843 (Iterations/Sec)|1740.881 (Iterations/Sec) | +28.6% | | dhrystone |1146 DMIPS |2368.33 DMIPS | +106% | Known issue: this implementation does not work on Arm64 architecture.
The baseline JIT compiler design involves tracing an EBB when its usage frequency exceeds a predetermined threshold. We then utilize a code generator to convert the instruction sequence into C code. The C code is subsequently compiled using MIR, and the resulting target machine code is stored in the code cache for future utilization. The primary objective of introducing the baseline JIT compiler is to enhance the execution speed of RISC-V instructions with minimal modification. This implementation requires three additional components: a code generator, MIR compiler, and code cache, while maintaining the original design of the interpreter. Furthermore, this baseline JIT compiler serves as the foundational target for future improvements. | Metric | master | baseline JIT |Speedup | |-----------+-------------------------+--------------------------+--------| | CoreMark |1352.843 (Iterations/Sec)|1740.881 (Iterations/Sec) | +28.6% | | dhrystone |1146 DMIPS |2368.33 DMIPS | +106% | Known issue: this implementation does not work on Arm64 architecture.
The baseline JIT compiler design involves tracing an EBB when its usage frequency exceeds a predetermined threshold. We then utilize a code generator to convert the instruction sequence into C code. The C code is subsequently compiled using MIR, and the resulting target machine code is stored in the code cache for future utilization. The primary objective of introducing the baseline JIT compiler is to enhance the execution speed of RISC-V instructions with minimal modification. This implementation requires three additional components: a code generator, MIR compiler, and code cache, while maintaining the original design of the interpreter. Furthermore, this baseline JIT compiler serves as the foundational target for future improvements. | Metric | master | baseline JIT |Speedup | |-----------+-------------------------+--------------------------+--------| | CoreMark |1352.843 (Iterations/Sec)|1740.881 (Iterations/Sec) | +28.6% | | dhrystone |1146 DMIPS |2368.33 DMIPS | +106% | Known issue: this implementation does not correctly work on Apple M1 MacOS.
The baseline JIT compiler design involves tracing an EBB when its usage frequency exceeds a predetermined threshold. We then utilize a code generator to convert the instruction sequence into C code. The C code is subsequently compiled using mir, and the resulting target machine code is stored in the code cache for future utilization.
The primary objective of introducing the baseline JIT compiler is to enhance the execution speed of RISC-V instructions with minimal modification. This implementation requires three additional components: a code generator, mir compiler, and code cache, while maintaining the original design of the interpreter. Furthermore, this baseline JIT compiler serves as the foundational target for future improvements.