-
Notifications
You must be signed in to change notification settings - Fork 136
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
Clang/LLVM as code generator for uBPF #72
Comments
The simpler version of this: add a function to load native machine code from an object file and execute that. The compiler invocations and Clang/LLVM APIs are far too complicated, flexible, and version dependent to be worth accessing from ubpf; let the user deal with that instead, we only care about the native code anyway. |
Agreed with @jpsamaroo, LLVM would be a very heavy dependency. It'd be interesting to see how much performance could be gained from an optimizing compiler vs ubpf's straightforward instruction translation but it would be better as a separate project. If there are portions of ubpf that would be useful for this I wouldn't mind adding new public APIs for them. |
Thanks, that makes a lot of sense. Can't really say how much gain there would be until we try it though. Folks on the Ebpf-For-Windows project suggested posting it here as it isn't a Windows specific proposal, but a separate project also makes sense. |
Clang/LLVM as code generator for uBPF
Overview
Clang/LLVM has a much richer tool chain for generating optimal ISA-specific instruction sequences. Proposal is to use LLVM to convert eBPF byte code to optimal native instruction sequences.
Background
Clang/LLVM has a language neutral internal representation (IR). Various front-ends produce IR that is then handed off to back-ends to produce optimal and secure ISA-specific machine code. LLVM code generation is platform aware and can take advantage of advanced processor features like vectored / SIMD instructions (via auto-vectorization) as well as having support for speculative load hardening and other security features.
Proposal
inlining of helper functions).
Expected benefits
to JIT correctly on all these platforms.
flow graph as IR.
to the generated code.
Challenges
The text was updated successfully, but these errors were encountered: