Summary: Currently the `--lto-emit-llvm` option writes out the post-internalization bitcode. This is the bitcode before any optimizations or other pipelines have been run on it. This patch changes that to use the pre-codegen module, which is the state of the LLVM-IR after the optimizations have been run. I believe that this makes sense as the `--lto-emit-llvm` option seems to imply that we should emit the final output of the LLVM pass as if it were the desired output. This should include optimizations at the requested optimization level. My main motivation for this change is to be able to use this to link several LLVM-IR files into a single one that I can then pass back to `ld.lld` later (for JIT purposes).
16 KiB
16 KiB