KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
485 stars 218 forks source link

Enqueue kernel: translation of target specific bits #204

Open AnastasiaStulova opened 5 years ago

AnastasiaStulova commented 5 years ago

Clang emits blocks in IR in a format of a struct some of the fields are however target specific.

     // struct __opencl_block_literal_generic {
     //   int __size;
     //   int __align;
     //   __generic void *__invoke;
     //   /* custom fields */
     // };

When we compile for SPIR we can't add the target specific fields. Do we need a similar mechanism for target specific functionality? Modifying the structs in the IR module after its generation is known to be error prone mainly because we need to track all accesses to it that might need to be changed.

Also I generally don't get how can something be translated to run on some specific target without taking target into account.

AnastasiaStulova commented 5 years ago

BTW, after checking the prototype of DSE instruction in SPIR-V spec, I can't quite understand how does it represent the captures.

AnastasiaStulova commented 5 years ago

Target info: need to see if there are other use cases requiring target knowledge. Captures: create issue for SPIR-V environment spec.

AnastasiaStulova commented 5 years ago

There seems to be no other problems discovered yet. Closing the issue.