forked from OSchip/llvm-project
[OpenMP] Make complex soft-float functions on the GPU weak definitions
To avoid linkage errors we have to ensure the linkage allows multiple definitions of these compiler inserted functions. Since they are on the cold path of complex computations, we want to avoid `inline`. Instead, we opt for `weak` and `noinline` for now.
This commit is contained in:
parent
305b500eaf
commit
e3e47e8035
|
@ -18,7 +18,7 @@
|
|||
#pragma push_macro("__DEVICE__")
|
||||
#ifdef _OPENMP
|
||||
#pragma omp declare target
|
||||
#define __DEVICE__ __attribute__((noinline, nothrow, cold))
|
||||
#define __DEVICE__ __attribute__((noinline, nothrow, cold, weak))
|
||||
#else
|
||||
#define __DEVICE__ __device__ inline
|
||||
#endif
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
#include <complex.h>
|
||||
#endif
|
||||
|
||||
// CHECK-DAG: define {{.*}} @__mulsc3
|
||||
// CHECK-DAG: define {{.*}} @__muldc3
|
||||
// CHECK-DAG: define {{.*}} @__divsc3
|
||||
// CHECK-DAG: define {{.*}} @__divdc3
|
||||
// CHECK-DAG: define weak {{.*}} @__mulsc3
|
||||
// CHECK-DAG: define weak {{.*}} @__muldc3
|
||||
// CHECK-DAG: define weak {{.*}} @__divsc3
|
||||
// CHECK-DAG: define weak {{.*}} @__divdc3
|
||||
|
||||
// CHECK-DAG: call float @__nv_scalbnf(
|
||||
void test_scmplx(float _Complex a) {
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
#include <complex>
|
||||
|
||||
// CHECK-DAG: define {{.*}} @__mulsc3
|
||||
// CHECK-DAG: define {{.*}} @__muldc3
|
||||
// CHECK-DAG: define {{.*}} @__divsc3
|
||||
// CHECK-DAG: define {{.*}} @__divdc3
|
||||
// CHECK-DAG: define weak {{.*}} @__mulsc3
|
||||
// CHECK-DAG: define weak {{.*}} @__muldc3
|
||||
// CHECK-DAG: define weak {{.*}} @__divsc3
|
||||
// CHECK-DAG: define weak {{.*}} @__divdc3
|
||||
|
||||
// CHECK-DAG: call float @__nv_scalbnf(
|
||||
void test_scmplx(std::complex<float> a) {
|
||||
|
|
Loading…
Reference in New Issue