Calls to sin() don't get converted to sinf, leading to inefficient use of vector variants with -fveclib=ArmPL
https://godbolt.org/z/fE16nGPxP
#include <math.h>
void foo(float *p)
{
for (int x=0; x<999; ++x) {
p[x] = sin(p[x]);
}
}
generates calls to armpl_vsinq_f64 instead of armpl_vsinq_f32.
If we replace that code with sinf it works fine:
#include <math.h>
void foo(float *p)
{
for (int x=0; x<999; ++x) {
p[x] = sinf(p[x]);
}
}
I'm reasonably sure it's legitimate to implicitly switch to sinf(), and this would lead to double the vector throughput.
@llvm/issue-subscribers-backend-aarch64
Author: Will Lovett (willlovett-arm)
#include <math.h>
void foo(float *p)
{
for (int x=0; x<999; ++x) {
p[x] = sin(p[x]);
}
}
generates calls to armpl_vsinq_f64 instead of armpl_vsinq_f32.
If we replace that code with sinf it works fine:
#include <math.h>
void foo(float *p)
{
for (int x=0; x<999; ++x) {
p[x] = sinf(p[x]);
}
}
I'm reasonably sure it's legitimate to implicitly switch to sinf(), and this would lead to double the vector throughput.
We do this if the function is a @sin, but not for @llvm.sin intrinsics.
https://godbolt.org/z/MTKefx5Yr
Should be fixed by https://github.com/llvm/llvm-project/pull/139082
Amazing turnaround! Thanks @guy-david , all 🙏