[LLVMdev] inline callsites whose function definitions are in different file?

Chuck Zhao czhao at eecg.toronto.edu
Tue Jul 27 10:00:32 PDT 2010


  On 7/27/2010 12:53 PM, Devang Patel wrote:
> On Tue, Jul 27, 2010 at 9:46 AM, Chuck Zhao<czhao at eecg.toronto.edu>  wrote:
>
>> I don't, and the compiler doesn't neither, that is the problem, unless I do
>> hacking at compile time.
>> E.g.:
>> - put all such function's definitions into file1.c
>> - force to compile file1.c 1st.
>> - when compiling file2.c:
>>   . read file1.bc
>>   . attach to file2's module
>>   - do inline analysis + inlining
>>   - detach the attached file1.bc functions
>> - repeat for other files.
>> ...
> This is what LTO does.
>
> One difference is, usually LTO stitches all modules together before
> inlining instead of individually attaching/detaching .bc files. This
> is because what if file2.c uses a function from file9.c ?
>
> -
> Devang
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Ya, I agree with you. The answer is, do such types of inlining at link time.

Thanks Devang

Chuck




More information about the llvm-dev mailing list