[PATCH] D22751: AMDGPU Device Libs pass.

Yaxun Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 08:11:28 PDT 2016


yaxunl added a comment.

I am thinking probably this should be a post-linking pass.

The library functions can be identified by prefixes or name mangling. All OpenCL builtin functions start with _Z ( IA64 mangled ) and other library functions have specific prefixes. We add an extra option argument to all library functions. If a library function calls other library functions, pass this option argument down.

Non-library functions are compiled with cl- options which become function attributes. We just need to translate them to option mask and pass it to the OpenCL buitin functions called by this non-library function.

After this transformation, all library function calls will have an option argument equivalent to the cl- options they are compiled with in the original compilation unit.


https://reviews.llvm.org/D22751





More information about the llvm-commits mailing list