[LTO API] add lto_codegen_set_module to help ld64 debug LTO issues
mren at apple.com
Fri Feb 20 10:50:10 PST 2015
Yes, ld64 will have an option for this, with this option, ld64 will skip the IR passes as well. "llc combined.bc" will help us debug the backend passes, but we sometimes want to directly debug ld64 source codes (things in ld64 that run after backend passes).
It is much faster to debug “ld64 combined.bc” without IR passes than to debug “ld64 a.o b.o …”.
> On Feb 19, 2015, at 6:06 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> How would this be used? Would ld64 get an option for it? How would
> ld64 -no_optimize_single_ir combined.bc ...
> be different from
> llc combined.bc -o foo.o -filetype=obj
> ld64 foo.o ....
> On 19 February 2015 at 20:22, Manman Ren <mren at apple.com> wrote:
>> Hi Rafael and others,
>> When debugging LTO issues with ld64, I sometimes use -save-temps to save the merged optimized bitcode file, then invoke ld64 again on the single bitcode file.
>> I found out that llvm linking a single bitcode file via lto_codegen_add_module will generate a different bitcode file from the single input.
>> This makes debugging hard. With the newly-added lto_codegen_set_module, we can make sure the destination module is the same as the input.
>> The patch is attached. Let me know your thoughts,
More information about the llvm-commits