llvm
5e7ba908 - [SYCL] Fix host compilation crash for sycl::sincos with fp-accuracy option (#22500)

Commit
11 days ago
[SYCL] Fix host compilation crash for sycl::sincos with fp-accuracy option (#22500) We found a compiler crash issue when building any source code invoking sycl::sincos with -ffp-accuracy=* option, the crash issue happens in host compilation. When -ffp-accuracy=* is specified, the compiler's MaybeEmitFPBuiltinofFD function matches any function call named "sincos" by string name and attempts to replace it with the llvm.fpbuiltin.sincos intrinsic. This intrinisic signature aligns with glibc's (void sincos(double, double *, double *)) but differs from double sycl::sincos(double, double *). On host compilation, the user's call to sycl::sincos(x, &c) resolves to a C++ template function with FD->getName() == "sincos". The StringSwitch matches it, creates the 3-arg intrinsic, then Builder.CreateCall is invoked with only 2 arguments — triggering the assertion "Calling a function with bad signature!". This issue doesn't exist in device compilation, sycl::sincos is just a wrapper of __spirv_ocl_sincos for device compilation and compiler won't do the incorrect match and replacement. --------- Signed-off-by: jinge90 <ge.jin@intel.com>
Author
Parents
Loading