[PATCH] D78979: OpenCL: Include builtin header by default

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 28 03:43:33 PDT 2020


Anastasia added a subscriber: svenvh.
Anastasia added a comment.

> I'm somewhat confused by the way this is supposed to work, or why a
>  separate option exists for OpenCL. The other language flags seem to be
>  implemented in the driver, not cc1 like OpenCL. I'm not sure this is
>  the right set of flag naming decisions, or if we really need the
>  fno-include-default-header cc1 flag.

Originally we didn't want to include the header by default for 2 reasons:

1. Many vendors used their own header.
2. It takes long time to parse the header.

However, we might be in a different position now because the header exists for long time and I think we have fixed all the issues so it should be recommended to use it instead of vendor's header. It is generally good to include it by default for the upstream user. However, I am still concerned with the parsing time. To mitigate this we have developed an alternative way to include the functions utilizing TableGen:
https://llvm.org/devmtg/2019-10/talk-abstracts.html#lit5
Unfortunately, we are not that far with testing yet to be able to use it by default. But hopefully we should be able to switch to is as a default option at some point soon.

To summarize I am generally not against the inclusion of the header by default and I think it's best if we just reuse the standard non-OpenCL specific flags. We would just need to understand how it will work with the fast TableGen-based solution that is enabled using `-fdeclare-opencl-builtins`. I am looping in @svenvh to discuss this further. Sven, do you think we should rename this flag due to current proposed change? Should it be moved out of `-cc1` too?


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

https://reviews.llvm.org/D78979





More information about the cfe-commits mailing list