-
Notifications
You must be signed in to change notification settings - Fork 205
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
setinlined not working in JIT mode on LLVM >= 17 #671
Comments
If I find the time, I can try to bisect it but maybe it's just a result of the LLVM change |
Yeah, I was wondering if this was going to come bite us. LLVM 17 completely removed the old optimization pipeline. Therefore, I had to make a hard switch over with that LLVM version to the new optimization pipeline. In the process, I had to remove the manual inliner. Maybe it's possible to adapt, but to be honest the new optimization pipeline is pretty undocumented and even the stuff I've tried to do so far has been pretty inscrutable. There is some good news: this impacts JIT mode only. If you use Add the following to the bottom of print(terralib.saveobj(nil, "llvmir", {bar=bar})) Then you'll see it print out: Output of running Terra on LLVM 18 with AOT mode
So then there are two possible workarounds:
|
Ah I see, that makes sense. I think I can live with that workaround, although probably prudent to print out a warning or something for Tangentially but also related, I was wondering if there was an easy way to load/link against Although for this case, I can produce llvm bitcode and link that back in, which works (but has the disadvantage of linking into the global namespace?)
|
I have produced a set of Linux binaries for 1.2.0 with LLVM 16, and attached them to the release with a note about this as a known issue. It looks ok on my end, but please check to see if this works for you: The call Line 3991 in cc543db
https://llvm.org/doxygen/classllvm_1_1sys_1_1DynamicLibrary.html#a53d32d3b3baefdec31d3d94b0586d437 |
yup it looks like it works! thank you! I did briefly look into the pass system myself to see if I could figure it out but I gave up haha. llvm docs are as inscrutable as always. I tried reading the Rust crate docs too just to see if I could make a JIT engine with inlining. |
terra-Linux-x86_64-094c5ad (1.1.1)
terra-Linux-x86_64-094c5ad (1.2.0)
I noticed this from the disassembly on one of my personal projects, but it seems like inlining doesn't work and I checked against the existing test and that seems to be the case.
The text was updated successfully, but these errors were encountered: