BOLT: Can bolt process PE files?

LLVM BOLT seems only support 64bit ELF file, will bolt support process and optimize PE files in windows?
Thanks for your reply!

Not at the moment. There has been some talk about adding it. But afaik no one is currently working on it.

1 Like

I am a beginner in BOLT, maybe some statements are not quite correct, if there are mistakes please correct me.
As an optimizer, BOLT receives X86 code segment as input from some components of LLVM which parse executable files or dynamic link libraries to get X86 code segment. Now LLVM seems to have provided ELF and COFF(PE) format file parsing, since BOLT is decoupled from the file parsing stage, then BOLT should be able to handle any X86 code segment no matter which kind of file it come from.

As @tobiashieta mentioned, BOLT team has no plan to add it.
@TaoTao-real, BOLT reads and rewrites ELF files directly using LLVM libraries. BOLT also has initial support for MachO format, so if you’re interested in adding PE support, you may take a look into that.

Perhaps a bigger problem is collecting the profile to drive optimizations – either BOLT instrumentation for PE would need to be implemented, or some sort of sampling using LBR (~Linux perf). However, I’m not aware of perf-equivalent facilities on Windows (except VTune but I’m not sure if it can export the traces).

1 Like