[LLVMdev] [PATCH][RFC] Add llvm.codegen Intrinsic To Support Embedded LLVM IR Code Generation

Tobias Grosser tobias at grosser.es
Mon May 7 01:31:17 PDT 2012


On 05/01/2012 11:21 PM, dag at cray.com wrote:
> Justin Holewinski<justin.holewinski at gmail.com>  writes:
>>      Do we allow more than one Module per file?  If not, that seems like an
>>      arbitrary limitation.  If we allowed that we could have each module
>>      specify a different target.
>>
>> That could work.
>
> Given your questions about globals above, I think it might be a
> requirement unless we want to require code for separate targets live in
> separate files.  I think that's too restrictive because some opt pass
> might want to extract kernels and put them on separate targets.

I think we need several modules per file. Supporting AMDIL and PTX at 
the same time sounds more than useful.

Another question that pops up to me. If we go support several modules, 
how would the command line options to opt look like? Do we want to make 
all options sub-module specific? Getting this user friendly may be 
difficult. The same for the output of llc. At the moment llc can dump 
the assembly to stdout. Would you dump the assembly of the different 
modules to stdout or do you want to support multiple -o options to 
specify the various output files?

The same for the LLVM CodeGen/Target API. It must possibly be changed to 
support the output of several modules or the specification of different 
options for each module. We also have the same problems as Justin 
pointed out for the codegen intrinsic. Some llc options are globals, 
they would need to be made Codegen options, if we want to set them on a 
per-module basis.

Cheers
Tobi





More information about the llvm-dev mailing list