[LTO API] add lto_codegen_set_module to help ld64 debug LTO issues
Rafael Espíndola
rafael.espindola at gmail.com
Fri Feb 20 11:41:22 PST 2015
Well, the impact of the patch is pretty small. So if you and Duncan
think it is helpful I am OK with it. Please just add an option to
llvm-lto and a test using it.
On 20 February 2015 at 13:50, Manman Ren <mren at apple.com> wrote:
> HI Rafael,
>
> 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 …”.
>
> Thanks,
> Manman
>
>> 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 ....
>>
>> Cheers,
>> Rafael
>>
>>
>> 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,
>>>
>>> Thanks,
>>> Manman
>>>
>>>
>>>
>>>
>>>
>
More information about the llvm-commits
mailing list