[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:16:50 PST 2019

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.
> John.

More information about the cfe-dev mailing list