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

dag at cray.com dag at cray.com
Mon Apr 30 13:03:09 PDT 2012


<dag at cray.com> writes:

> Tobias Grosser <tobias at grosser.es> writes:
>
>> To write optimizations that yield embedded GPU code, we also looked into 
>> three other approaches:
>>
>> 1. Directly create embedded target code (e.g. PTX)
>>
>> This would mean the optimization pass extracts device code internally 
>> and directly generate the relevant target code. This approach would 
>> require our generic optimization pass to be directly linked with the 
>> specific target back end. This is an ugly layering violation and, in 
>> addition, it causes major troubles in case the new optimization should 
>> be dynamically loaded.
>
> IMHO it's a bit unrealistic to have a target-independent optimization
> layer.  Almost all optimization wants to know target details at some
> point.  I think we can and probably should support that.  We can allow
> passes to gracefully fall back in the cases where target information is
> not available.

I think I misread your intent here.  It is indeed a very bad layering
violation to have opt generate code.  In the response above I am talking
about making target characteristics available to opt passes if it is
available.  I think the latter is important to get good performance.

                                  -Dave



More information about the llvm-dev mailing list