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

--- Comment #2 from mjr19 at cam dot ac.uk ---
Ah, I see. An inability to alternate negation with noop also means that
conjugation is treated suboptimally.

  do i=1,n
     c(i)=conjg(c(i))
  enddo

Here gfortran-13 and -14 are differently suboptimal, and again it appears to be
because they don't wish to alternate noops and negations along a single vector. 

In this case -14 fails to vectorise, and loads just the imaginary values,
negating them and storing them, moving with a stride of two. Not a bad answer,
but one which would not generalise well should the loop contain other
operations on c(i).

In practice almost every vector operation can be trivially alternated with a
noop, as +, -, *, xor, or, and, all have special values which reduce the
operation to a noop and which could be used to pad things. Is there no scope
for making the SLP build more flexible here, as otherwise shuffling and
permuting can cost both time and registers?

I also note that it means that -ffast-math (or simply -fno-signed-zeros) slows
down these examples. This is unfortunate, as there are cases in which
-fno-signed-zeros gives a useful performance increase, but this can be reduced
or reversed when there are cases, perhaps in the same source file, when it
reduces performance.

Reply via email to