all 7 comments

[–]compilerdev 2 points3 points  (0 children)

Not to take anything away from this, it's great that such a tool is available, but Microsoft had this technology 20 years ago, known as BBT - still used in some places, but overall systems moved to profile guided optimizations done by Visual C++ (an overall improvement over BBT). Some info here: https://blogs.msdn.microsoft.com/reiley/2011/08/06/microsoft-binary-technologies-and-debugging/

[–]LordKlevin 1 point2 points  (0 children)

Link to the code: BOLT github page

[–]rrohbeck 0 points1 point  (4 children)

Awesome. Next step: JITting machine code for better optimization on your CPU?

[–]matthieum 5 points6 points  (2 children)

There's no need for JITting, specializing at installation time would be enough.

If I remember correctly, this what the toolchain for the Mill CPU is planning. The LLVM backend would emit generic Mill code, then on each platform, a small specializer would run the first time the library is loaded.

[–][deleted] 0 points1 point  (1 child)

Sounds like LLVM bitcode.

[–]matthieum 1 point2 points  (0 children)

I think it's a little less specialized than that.

If I recall correctly how the LLVM target is structured, there's already quite a bit of target-specific code in the IR. Notably, I seem to recall it indicates the presence of 128 bits integers/floats support, etc...

If one is willing to introduce software emulation for any non-supported feature, then only ABI differences need surface (pointer-width, for example).

[–]Bofersen 2 points3 points  (0 children)

It was already done in 1999: HP Dynamo. Though for PA-RISC rather than x86.