<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/139044>139044</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Calls to sin() don't get converted to sinf, leading to inefficient use of vector variants with -fveclib=ArmPL
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:AArch64,
            SVE
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          willlovett-arm
      </td>
    </tr>
</table>

<pre>
    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.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMlE_PozYQxj_NcBm9kTMGEg4cSLKpVurhlSr1ujJ4AHeNndqGvNtPXznJatU_hx4rWWJkHp6xfjxjFaOZHHML1QmqS6HWNPvQ3o211m-c0psKS9F7_a2dU7pFkB3QFeg6ed17m3Y-TEDXP4Cu46d97X56_3gH0eVVi9cSHZA0brCrZgR5XlSadzPIT0_h5o3G0Xug42i9SgjU3YCa_PZwAtGNPiDQ0biEHyAvAuQpF-emaXIJdAI6fQA1-NQjIt6gOn1AdUGQF4zGAR2_b2Vr-dTB4fLocvmXI4tuYsdBJY44KGsjJo9QCxWWm_2yReN-_zLWJdQCjYuJlUY__kMgCWqxe_p9HvHOGPhm1cCYZpVw8JrxbtKcP4zGjQ-7hHcfvkYcjeMM_P8Gc_wPNP-K8jPQYcHAKnqnevsN4xoYTQI6RLQ8mWQWlTgjNsvNmsGkLLqbNMx589U0N6MzKqcxzSbi3a9Wo83sk0ft195msIwbD8kHTHPw6zTf1rQrdCt1IxtVcLs_lHXd0L4UxdwOQ3lUWsq6IZK0L4mJh4p1r49ZIQrTkqBKVOIojvuqFLuatCj7oTnIum6YCErBizJ2Z-225IEoTIwrt3vZiLIsrOrZxseAEfVq-MpOg-y6LgxzXQIR0BmIfvn1U66rSxHabPTWr1OEUlgTU_xhnUyy3J6_B_IZ7fy7tHdAh4QT51i5jUNi_YPd-YHJuOnB2PE4msGwS7hGzsF9EdtUMMql-Azl27jxYE0P8tKF5f3nYg327_eASfPa7wa_AF3zKV-Pt1vwv_GQgK4PGhHo-gKytfRnAAAA__8XeFQ2">