Maarten Bovijn
2013-Dec-09 16:42 UTC
[LLVMdev] Custom bitcode format and executing it in the interpreter.
Hello, I'm using llvm for some experiments and I was wondering if you might be able to give me some more insight on what I'm planning to do. :) I would like to store some llvm ir to a custom bitcode format. (Let's say I have 5 different versions of very similar looking bitcode, where the only difference are the enum numbers of each bitcode (see /include/llvm/Bitcode/LLVMBitCodes.h)) The bitcode format will depend on the instructions in the ir. For example when coming across an "add" instruction when converting to bitcode I want to use another bitcode representation then the one the previous instruction used. Could I perhaps do this by adjusting the function WriteFunction in /lib/BitCode/Writer/BitcodeWriter.cpp by analysing every basic block that passes by? Or are there less invasive methods I could use to accomplish my goal? Perpaps passes can be a solution? The next thing I want to do is interpret my custom bitcode file comprising of different bitcode representations. I'd for example read in the first bitcode and determine on that which bitcode representation to use for the next instruction. The problem I see doing that is that right now in the interpreter (lli) bitcode gets read in and converted to llvm ir, before execution even starts. My goal is to convert bitcode to llvm ir as the execution progresses. What are your thoughts on that? Any help is much appreciated! Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131209/a3c3ca4b/attachment.html>
Maybe Matching Threads
- [LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
- mutateType on AllocaInst problem
- [LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
- [LLVMdev] Next GC patch for review
- RFC: APIs for bitcode files containing multiple modules