[llvm-dev] Four bitcode generated with plugin-opt=save-temps

Teresa Johnson via llvm-dev llvm-dev at lists.llvm.org
Tue May 15 06:19:53 PDT 2018


These are the bitcode at different stages of the LTO portion of the
compile. LTO merges the IR for all files being linked and optimizes them as
a single monolithic module. The preopt.bc is the merged IR just after
merging and before performing any LTO optimizations. internalize.bc is
after performing whole program internalization. opt.bc is after the
optimization pipeline, and .precodegen.bc is immediately before native code
generation.

The emit-llvm option will give you the IR for a single source file when you
compile it with -c. All of those files when combined give the IR in the
preopt.bc temp file.

Hope that helps,
Teresa

On Tue, May 15, 2018 at 4:43 AM Muhui Jiang via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi
>
> I use the LDFLAGS=" -flto -fuse-ld=gold  -Wl,-plugin-opt=save-temps " to
> generate the makefile and to make the whole program. However,  found four
> different kinds of bitcode for each target. For example, I am compiling
> coreutils. For the program "nohup", I can get
>
>  nohup.0.0.preopt.bc
>  nohup.0.2.internalize.bc
>  nohup.0.4.opt.bc
>  nohup.0.5.precodegen.bc
>
> If I am right, I can also get the bitcode with emit-llvm option in clang.
> May I know which bc among the above four should be the same as the one I
> generated with emit-llvm. More information are very thankful.
>
> Regards
> Muhui
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180515/4d0093b6/attachment.html>


More information about the llvm-dev mailing list