[PATCH] D71241: [OpenMP][WIP] Use overload centric declare variants
Hal Finkel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 12 14:39:32 PST 2019
hfinkel added a comment.
In D71241#1779779 <https://reviews.llvm.org/D71241#1779779>, @ABataev wrote:
> Here is the example that does not work with the proposed solution but works with the existing one:
>
> static void cpu() { asm("nop"); }
>
> #pragma omp declare variant(cpu) match(device = {kind(cpu)})
> static __attribute__((used)) void wrong_asm() {
> asm ("xxx");
> }
>
>
> The existing solution has some problems with the delayed error messages too, but they are very easy to fix.
I don't understand that this example represents. Unused static functions are generally not emitted. In general, if we perform overload resolution in Sema and, thus, only use the variants that are selected, then others that are static won't even be emitted. Here you're forcing the `wrong_asm` function to be used, but if it's used on all devices (host and target), then it's used, and we need to deal with the inline asm regardless.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71241/new/
https://reviews.llvm.org/D71241
More information about the cfe-commits
mailing list