This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64410] gcc 25% slower than clang 3.5 for adding complex numbers
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Jan 2015 15:04:23 +0000
- Subject: [Bug c++/64410] gcc 25% slower than clang 3.5 for adding complex numbers
- Auto-submitted: auto-generated
- References: <bug-64410-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64410
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 34402
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34402&action=edit
patch to pattern-detect the load/store
This pattern matches real/imagpart uses and single-use complex stores and
transforms them to component-wise accesses in forwprop. Together we vectorize
the loop now and produce:
.L28:
movupd (%rbx,%rax), %xmm1
movupd (%r15,%rax), %xmm0
addpd %xmm1, %xmm0
movups %xmm0, 0(%r13,%rax)
addq $16, %rax
cmpq %rax, %rdx
jne .L28
note that we need a runtime alias check to disambiguate things (because
std::vector memory cannot be disambiguated statically) and similarly we
cannot prove sufficent alignment to use aligned loads/stores.