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

Tobias Grosser tobias at grosser.es
Mon May 7 14:13:53 PDT 2012


On 05/07/2012 06:13 PM, dag at cray.com wrote:
> Tobias Grosser<tobias at grosser.es>  writes:
>
>> 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?
>
> I forgot to address this one.  With current OpenCL and CUDA
> specifications, there's no need to do multiple .o files.  In my mind,
> llc should output one .o (one .s, etc.).  Anything else wreaks havoc on
> build systems.

Yes, that's what I am advocating for. There is no need for all this 
complexity. Both standards store the embedded code as a string in the 
host module. That is exactly what the llvm.codegen intrinsic models. It 
requires zero further changes to the code generation backend.

In contrast, extending LLVM-IR to support heterogeneous modules requires 
us to add logic to the llvm code generation that knows how to link the 
different sub-modules.

Tobi



More information about the llvm-dev mailing list