[LLVMdev] Using the unused "version" field in the bitcode wrapper (redux)
David Chisnall
David.Chisnall at cl.cam.ac.uk
Wed Nov 5 01:33:56 PST 2014
On 5 Nov 2014, at 01:30, Sean Silva <chisophugis at gmail.com> wrote:
> Are there ever any plans to do so?
> (this question also goes out to every other vendor that is shipping an LTO toolchain or plans to. Chad?)
We (current hat: FreeBSD) have plans to bundle bitcode with packages and allow microarchitecture-specific optimisations to run at install time (e.g. ship generic x86-64 bitcode, codegen with the current host's schedules). We're also interested in a few other things in this area:
- If a package installs a shared library that is only used by one dependency, we want to link the bitcode and do LTO on the result.
- If a package has a known vulnerability, we want to be able to automatically trigger multicompiler-style diversity (recompile with randomised code layouts, nop insertion to break gadgets, and so on).
- Have the kernel periodically harvest profiling data and, after a program has run with its bundled binary a few times, recompile based on that information. In particular, recent Intel chips let you (relatively) cheaply log every branch into an in-memory buffer. Running this periodically should give some statistical sampling of code flow within a binary, without too much overhead.
Most of this requires other pieces of infrastructure that aren't in place yet, but being able to tell cheaply whether the bitcode libraries that we have are compatible with the installed toolchain (or whether we need to install another one) would be helpful. It's not essential for us to put this in the bitcode itself though, as we can add it to package metadata if required.
David
More information about the llvm-dev
mailing list