mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 05:56:05 +00:00

Similar to how ICC handles CPU-Dispatch on Windows, this patch uses the resolver function directly to forward the call to the proper function. This is not nearly as efficient as IFuncs of course, but is still quite useful for large functions specifically developed for certain processors. This is unfortunately still limited to x86, since it depends on __builtin_cpu_supports and __builtin_cpu_is, which are x86 builtins. The naming for the resolver/forwarding function for cpu-dispatch was taken from ICC's implementation, which uses the unmodified name for this (no mangling additions). This is possible, since cpu-dispatch uses '.A' for the 'default' version. In 'target' multiversioning, this function keeps the '.resolver' extension in order to keep the default function keeping the default mangling. Change-Id: I4731555a39be26c7ad59a2d8fda6fa1a50f73284 Differential Revision: https://reviews.llvm.org/D53586 llvm-svn: 345298
10 lines
494 B
C
10 lines
494 B
C
// RUN: %clang_cc1 -triple arm-none-eabi -fsyntax-only -verify %s
|
|
|
|
int __attribute__((target("sse4.2"))) redecl1(void) { return 1; }
|
|
//expected-error@+2 {{function multiversioning is not supported on the current target}}
|
|
//expected-note@-2 {{previous declaration is here}}
|
|
int __attribute__((target("avx"))) redecl1(void) { return 2; }
|
|
|
|
//expected-error@+1 {{function multiversioning is not supported on the current target}}
|
|
int __attribute__((target("default"))) with_def(void) { return 1;}
|