https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109301

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Tried -Ofast -mavx512f
> #include <math.h>
> 
> void
> foo (double *a, double *b)
> {
>   for (int i = 0; i < 1024; i++)
>     a[i] = pow (a[i], b[i]);
> }
> 
> void
> bar (double *a)
> {
>   for (int i = 0; i < 1024; i++)
>     a[i] = cbrt (sqrt (a[i]));
> }
> 
> void
> baz (double *a)
> {
>   for (int i = 0; i < 1024; i++)
>     a[i] = cbrt (cbrt (a[i]));
> }
> but that doesn't trigger, it uses simd clones rather than internal functions.
> Strangely, bar isn't vectorized while foo and baz are.

I only see foo vectorized (with simdclones), neither bar nor baz are - probably
because cbrt isn't available in vector form and we don't resort to pow()
here for baz because

  /* cbrt(cbrt(x)) -> pow(x,1/9), iff x is nonnegative.  */
  (simplify
   (cbrts (cbrts tree_expr_nonnegative_p@0))
   (pows @0 { build_real_truncate (type, dconst_ninth ()); }))

doesn't trigger.  Later the 'powcabs' pass synthesizes cbrt(sqrt()) again
but at least for me no cbrt vectorized variant is available.

Reply via email to