[cfe-dev] [RFC] Delayed target-specific diagnostic when compiling for the devices.
Alexey Bataev via cfe-dev
cfe-dev at lists.llvm.org
Tue Jan 15 15:57:09 PST 2019
Could you reference such functions in the initializer? Could you call them indirectly? Could you take their addresses? Or they just can be directly called from other functions?
> 15 янв. 2019 г., в 18:16, Alexey Bataev <a.bataev at outlook.com> написал(а):
> Because currently this kind of the analysis is implemented in Codegen and Codegen decides, which function should be emitted and which is not.
> To implement it in Sema, we'll need to reimpelement almost everything from the codegen, because we will need to analyse all the statements in all functions. It significantly increases the compilation time.
> Best regards,
> Alexey Bataev
>>> 15 янв. 2019 г., в 18:01, John McCall <jmccall at apple.com> написал(а):
>>> On 15 Jan 2019, at 17:58, Alexey Bataev wrote:
>>> __host__ __device__ functions are still device functions and it means that they must be emitted when you compile for the device. You know, that the user marked those functions as the device functions. In OpenMP, you cannot say before the codegen phase whether the function is used on the device or not. We should not emit all the functions available, only those, which are used (implicitly or explicitly, directly or indirectly) in the target regions.
>> I don't see why you couldn't do that analysis in Sema.
More information about the cfe-dev