remill icon indicating copy to clipboard operation
remill copied to clipboard

Optimization idea: copy semantics functions as-needed into lifting module

Open pgoodman opened this issue 6 years ago • 2 comments

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.

pgoodman avatar Nov 18 '18 16:11 pgoodman

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 avatar Nov 19 '18 08:11 surovic

@surovic Remill already has similar functions to move code between modules.

pgoodman avatar Jan 07 '19 21:01 pgoodman