Mimimal implementation that I could use to demonstrate speedups. Will add inline comments where I think this is not satisfying yet. Apart from that, what do you think? Do you have proposals for improvements?
Originally I wanted a real ThinLTOLayer with a proper ThinLTOLayerMaterializationUnit, integration with llvm::orc::lookup(), etc. So far I failed to get the SymbolFlags handling right, when passing the MaterializationResponsibility down to the underlying IRLayer. Would be great to fix that and upstream it, but it's no hurry.
It's not currently possible to obtain the SearchOrder to check for existing entries. That's on purpose?