LTO API: lto_codegen_optimize and lto_codegen_compile_optimized

Manman Ren mren at apple.com
Fri Jan 30 12:01:55 PST 2015


We currently have lto_codegen_compile that runs IR passes and codegen passes. If we dump the bitcode file after lto_codegen_compile, codegen passes can modify IR (one example is StackProtector pass).
If we run “llc lto.opt.bc”, we will get assertion failure because llc runs StackProtector pass again.

To enable dumping bitcode file right before running the codegen passes, this patch splits lto_codegen_compile in 2
lto_codegen_optimize
lto_codegen_compile_optimize

Linker can choose to dump the bitcode file before calling lto_codegen_compile_optimize and we can debug the codegen passes from the dumped bitcode file.

I initially had a different proposal, thanks to Rafael for suggesting this solution!

Cheers,
Manman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto.patch
Type: application/octet-stream
Size: 9621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150130/a59b2a53/attachment.obj>


More information about the llvm-commits mailing list