-
Notifications
You must be signed in to change notification settings - Fork 41
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
Wrap LLVMBuildICmp #12
Comments
Definitely! I just meant that I wouldn't have the time to make LLVM.jl into a feature-complete wrapper, so I focused on getting the infrastructure ready along with some "implementation templates" / stubs. So if you have the time, maybe you could have a look at wrapping the builder calls you require?
The I should also take the time to document the package's internals, but in this case you only need to know that the underlying LLVM API returns opaque reference pointers (like LLVMValueRef) which LLVM.jl wraps in a more-specifically typed object (defined with Let me know if you have any questions! |
Okay, I'm quite new to the world of Julia and LLVM, but I actually tried doing that. In the simplest form, that would be something like this (?): icmp!(builder::Builder, op::UInt32, lhs::Value, rhs::Value, name::String="") =
Instruction(API.LLVMBuildICmp(ref(builder), op, ref(lhs), ref(rhs), name)) I actually got it working for me, but I have some issues left:
Aside from that, I would like to help wrapping some more stuff, as soon as I have the basics figured out. I spent another hour today to even get the package to build again after replacing it with my forked version to try that out... |
The tests fail now already? If so, that warrants an issue report.
I'd typeassert it to
Building can be tricky indeed, I don't think the current solution is solid enough yet -- see JuliaLang/julia#19302. What exactly did you run into? If you can't figure out something, just open a PR. It's sometimes easier to clone a branch and see what's happening than to figure it all out in the comments. |
Well, the tests failed after I tried to add my instruction between some existing tests, they work fine without those changes. ;) Building failed until I changed the code to use system-llvm, which is version 3.9.1 for me. Apparently, it wanted to use a 3.7.something-version that comes with Julia? I guess I will encounter that sometime again and could open an issue, but it's basically what you already know. |
Yeah we're only compatible with LLVM 3.9+. Beware that EDIT: if you have some experience with loading multiple copies of dynamic libraries on multiple platforms, please help me improve EDIT2: added a note to the README about version compatibility. |
First of all, I want to say that I really appreciate this project. ;)
Your readme says that higher-level wrappers are added "as the need arises". So, my meta-issue would be whether you take requests on this and how those should be made.
Currently, I could really use the icmp instruction, since branching is kindof pointless without conditions.
If you do not have time for this, I'll take a look at the lower-level API.
The text was updated successfully, but these errors were encountered: