librelist archives

« back to archive

One LLVM module per function?

One LLVM module per function?

From:
Siu Kwan Lam
Date:
2012-07-06 @ 23:19
Hi all,

It seems Translate creates a new LLVM module per function. Is there a 
reason behind this? I am concern about the following:
   * extra memory overhead to each function;
   * cannot perform some optimizations (inlining, ...) because LLVM 
optimizations are not inter-module capable;
   * function cannot refer to each other directly because LLVM does not 
support inter-module call. (must use linker to link the modules together)

Regards,
Siu Kwan

Re: [numba] One LLVM module per function?

From:
mark florisson
Date:
2012-07-06 @ 23:24
On 7 July 2012 00:19, Siu Kwan Lam <michael.lam.sk@gmail.com> wrote:
>
> Hi all,
>
> It seems Translate creates a new LLVM module per function. Is there a
> reason behind this? I am concern about the following:
>    * extra memory overhead to each function;
>    * cannot perform some optimizations (inlining, ...) because LLVM
> optimizations are not inter-module capable;
>    * function cannot refer to each other directly because LLVM does not
> support inter-module call. (must use linker to link the modules together)
>
> Regards,
> Siu Kwan

Feel free to adjust that and as much of the code generation as needed.
It needs to be reworked anyway.

Re: [numba] One LLVM module per function?

From:
Travis Oliphant
Date:
2012-07-06 @ 23:36
Agreed!  I don't think there should be a limitation of one function per module. 

-Travis

On Jul 6, 2012, at 6:24 PM, mark florisson wrote:

> On 7 July 2012 00:19, Siu Kwan Lam <michael.lam.sk@gmail.com> wrote:
>> 
>> Hi all,
>> 
>> It seems Translate creates a new LLVM module per function. Is there a
>> reason behind this? I am concern about the following:
>>   * extra memory overhead to each function;
>>   * cannot perform some optimizations (inlining, ...) because LLVM
>> optimizations are not inter-module capable;
>>   * function cannot refer to each other directly because LLVM does not
>> support inter-module call. (must use linker to link the modules together)
>> 
>> Regards,
>> Siu Kwan
> 
> Feel free to adjust that and as much of the code generation as needed.
> It needs to be reworked anyway.