public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to convince the vectorizer to issue vector instructions for this loop
@ 2021-08-09  1:40 James Matta
  0 siblings, 0 replies; only message in thread
From: James Matta @ 2021-08-09  1:40 UTC (permalink / raw)
  To: gcc-help

Hi All,
This is my first time turning to the gcc mailing lists. I apologize if I have chosen the wrong one.

I have a member function that is multiplying one array of complex numbers (stored as 2 arrays) by 3 other arrays of complex numbers (stored similarly) and outputting the results of those 3 sets of multiplications into different arrays. The arrays are all 64-byte aligned (even the ones in the shared_ptrs,) the array lengths are all powers of 2 and larger than 16, and I don’t do any aliasing. I have done my best to tell the compiler this via __restrict__, __builtin_assume_aligned, __builtin_unreachable, and assert. I know the code is vectorizable because clang did it off the bat, though the __builtin_assume_aligned does make it generate aligned load instructions instead of unaligned…
Anyways, the code is here:
https://godbolt.org/z/sd1KoYabf

So, my question is: What am I missing that will make the autovectorizer issue vector instructions instead of scalar?

Thank you all for your time, sorry to bug you with what I am sure is a relatively simple question.
Cheers,
James

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-09  1:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09  1:40 How to convince the vectorizer to issue vector instructions for this loop James Matta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).