remill
remill copied to clipboard
Optimization idea: copy semantics functions as-needed into lifting module
Right now, we load up a semantics module, then lift code into that module, then optimize that module, then typically move lifted code out of the semantics, or delete the semantics functions. It might be faster to instead:
- Load up a semantics module
- Create and prepare a new module where lifted code will reside
- When lifting code, copy any missing semantics functions into this new module, making them private and always inline.
The idea here being that the LLVM optimizer will have less to focus on with this smaller module.
Maybe the LLVM IR linker API might be of some use here:
http://www.llvm.org/doxygen/classllvm_1_1IRMover.html (Move IR from one module to another) http://www.llvm.org/doxygen/classllvm_1_1Linker.html (Link a module into another) http://llvm.org/doxygen/Cloning_8h.html (InlineFunction and CloneModule)
@surovic Remill already has similar functions to move code between modules.