[PATCH] D71179: [OpenMP][WIP] Initial support for `begin/end declare variant`

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 8 23:38:15 PST 2019


hfinkel added a comment.

In D71179#1774487 <https://reviews.llvm.org/D71179#1774487>, @jdoerfert wrote:

> In D71179#1774471 <https://reviews.llvm.org/D71179#1774471>, @ABataev wrote:
>
> > They do this because they have several function definitions with the same name. In our case, we have several different functions with different names and for us no need to worry about overloading resolution, the compiler will do everything for us.
>
>
> I think we talk past each other again. This is the implementation of `omp begin/end declare variant` as described in TR8. Bt definition, the new variant mechanism will result in several different function definitions with the same name. See the two tests for examples.


The intent of this feature is to allow us to include the device-function headers and the system headers simultaneously, giving preference to the device functions when compiling for the device, thus fixing a number of outstanding math.h OpenMP offloading problems. This definitely means that we'll have multiple functions with the same name and we need to pick the right ones during overload resolution.

@jdoerfert , how does the ".ompvariant" work with external functions? I see the part of the spec which says, "The symbol name of a function definition that appears between a begin declare variant...", but, if we append this name to, for example, the names of functions present in the device math library, won't we have a problem with linking?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71179





More information about the cfe-commits mailing list