[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 27 03:15:20 PDT 2021


Anastasia added a comment.

In D100980#2719043 <https://reviews.llvm.org/D100980#2719043>, @azabaznov wrote:

>> I am not sure, to be honest I personally think the extension pragma is a spec failure as it is not specified properly or to allow reasonable implementation
>
> Unfortunately it's already there :(
>
>> Anyway since there is not clear benefit that can be found now for the pragma I think we should minimize its use as much as possible.
>
> I personally agree, but I believe in order to go forward this patch should introduce diagnostics to commit the introduction of new functionality, I'm not sure what exactly it should be. I'm thinking of some pedantic one such as: "pragma enable is no longer required for type usage". What do you think?

Well I don't see how we can do this now because we still use the pragma for other cases. I only remove one use of it for declaring the types but there are others for example for literal conversion:
https://clang.llvm.org/doxygen/SemaExpr_8cpp_source.html#l00816

When the pragma is parsed we can't know why it is in the code to be able to issue any warning.

If we remove all uses of pragma for `cl_khr_fp64` we could do something like https://reviews.llvm.org/D91534. But we can't do this yet.

My current clean-up only covers one particular case of requiring pragma for declaring a type because I don't see why it is useful and it is safe to relax as it doesn't cause kernels to compile differently. We can look at other cases later but they are relatively infrequent and don't  cause lots of maintenance.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100980/new/

https://reviews.llvm.org/D100980



More information about the cfe-commits mailing list