Skip to content
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

Insights from another project #12

Open
darleybarreto opened this issue Sep 18, 2021 · 8 comments
Open

Insights from another project #12

darleybarreto opened this issue Sep 18, 2021 · 8 comments

Comments

@darleybarreto
Copy link

Hi William, how are you?

First I want say thank you for the great and detailed writing of your series on LLVM internals. Second, this is an impressive work and I wish all the best here! Unfortunately this kind of stuff is waaay out of my capacity, but hopefully I can help in the near future somehow. Until that day comes (if at all), I thought on contributing on a discussion, are you familiar with vicis? The goal seems to be making a codegen similar to LLVM (at some extent), but a more practical one seems to be LLVM-IR manipulation too.

I sincerely don't know how both project could mutually help each other, but it seemed relevant to ask.

@woodruffw
Copy link
Owner

Hi @darleybarreto!

This is incredible! I had no idea this existed, and it looks like the author(s) are aiming for a very similar goal. I might be misunderstanding, but the big difference seems to be that they're starting from the textual IR representation, while I'm starting from the binary ("bitcode") representation.

I'll reach out to them further to figure out whether there's a reasonable integration point between the projects, similarly to how #3 proposes that be integrate with llvm-ir.

@darleybarreto
Copy link
Author

Great, hopefully there are things to share between the projects!

@maekawatoshiki
Copy link

maekawatoshiki commented Jan 29, 2022

Hello, I'm the author of vicis! I didn't know this project existed.

but the big difference seems to be that they're starting from the textual IR representation

Yes I'm currently focusing on the textual representation, but I was gonna implement bitcode parser.
I'd like to say thank you to @woodruffw because mollusc is a perfect project to learn how the bitcode works.
Also I'm very interested in contributing to mollusc!

@woodruffw
Copy link
Owner

Awesome! More contributors are always welcome 🙂

Let me know if there's any way I can help on vicis as well -- you seem to be much further along than I am, and you've done some incredibly impressive stuff with hooking the IR up to codegen. If you do decide to implement a bitcode parser as well, you may find the llvm-bitstream and llvm-bitcursor crates in mollusc helpful -- they provide the lowest level parser for the format.

@maekawatoshiki
Copy link

vicis's code is currently way more messy than mollusc since I was not so familiar with the entire structure of LLVM in the beginning. Let me know if you wrote some code using vicis and found clumsy interface :)

Besides, the mollusc README.md says that it's gonna implement a high-level interface. I'm interested in if you already planned what to implement. I could help the part.

@woodruffw
Copy link
Owner

Yeah, the plan with the high-level interface was something similar to what you have with vicis: APIs for visiting each Function/BasicBlock/Instruction.

If you're interested in helping with that, I think that needs the most help is the llvm-mapper crate -- that's the component responsible for turning the bitstream into something resembling an llvm::Module, with all of the correct internal state. Right now it has support for a few basic components, but it badly needs support for FUNCTION_BLOCKs so that we can begin mapping the actual bodies of functions.

@maekawatoshiki
Copy link

I'll look into the llvm-mapper crate, and hopefully add support for FUNCTION_BLOCK. Thank you for providing useful information!

@woodruffw
Copy link
Owner

No problem! Thanks a ton for looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants