[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 --- Comment #7 from Bill Schmidt --- Author: wschmidt Date: Sun Sep 10 21:09:38 2017 New Revision: 251952 URL: https://gcc.gnu.org/viewcvs?rev=251952&root=gcc&view=rev Log: [gcc] 2017-09-10 Bill Schmidt Backport from mainline 2017-05-11 Bill Schmidt PR target/80695 * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Account for direct move costs for vec_construct of integer vectors. Backport from mainline 2017-07-23 Bill Schmidt PR target/80695 * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Reduce cost estimate for direct moves. [gcc/testsuite] 2017-09-10 Bill Schmidt Backport from mainline 2017-05-11 Bill Schmidt PR target/80695 * gcc.target/powerpc/pr80695-p8.c: New file. * gcc.target/powerpc/pr80695-p9.c: New file. Added: branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/pr80695-p8.c branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/pr80695-p9.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/config/rs6000/rs6000.c branches/gcc-7-branch/gcc/testsuite/ChangeLog
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 --- Comment #6 from Bill Schmidt --- Author: wschmidt Date: Sun Jul 23 15:32:37 2017 New Revision: 250461 URL: https://gcc.gnu.org/viewcvs?rev=250461&root=gcc&view=rev Log: 2017-07-23 Bill Schmidt PR target/80695 * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Reduce cost estimate for direct moves. Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 Bill Schmidt changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Bill Schmidt --- Fixed.
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 --- Comment #4 from Bill Schmidt --- Author: wschmidt Date: Thu May 11 20:16:02 2017 New Revision: 247928 URL: https://gcc.gnu.org/viewcvs?rev=247928&root=gcc&view=rev Log: [gcc] 2017-05-11 Bill Schmidt PR target/80695 * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Account for direct move costs for vec_construct of integer vectors. [gcc/testsuite] 2017-05-11 Bill Schmidt PR target/80695 * gcc.target/powerpc/pr80695-p8.c: New file. * gcc.target/powerpc/pr80695-p9.c: New file. Added: trunk/gcc/testsuite/gcc.target/powerpc/pr80695-p8.c trunk/gcc/testsuite/gcc.target/powerpc/pr80695-p9.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c trunk/gcc/testsuite/ChangeLog
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 Bill Schmidt changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2017-05-10 Ever confirmed|0 |1 --- Comment #3 from Bill Schmidt --- This is just a cost model problem in the rs6000 back end. We don't recognize the cost of the direct moves for a vec_construct. I have a patch in progress. Confirmed, BTW.
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 --- Comment #2 from Richard Biener --- On x86_64 vectorization is not profitable, likely due to the higher cost of unaligned vector stores? But yes, I can see that vectorizing it as _24 = VIEW_CONVERT_EXPR(_2); _25 = VIEW_CONVERT_EXPR(prephitmp_21); _26 = VIEW_CONVERT_EXPR(prephitmp_21); _27 = VIEW_CONVERT_EXPR(prephitmp_19); vect_cst__28 = {_27, _26, _25, _24}; vectp.6_29 = &f_8(D)->_IO_read_base; MEM[(char * *)vectp.6_29] = vect_cst__28; isn't good though the cost modeling looks reasonable (vector construction from scalar cost plus unaligned store cost). Now on x86_64 we construct the vector via the stack for some reason: _IO_new_file_overflow: .LFB0: .cfi_startproc movq8(%rdi), %rax movq%rax, -16(%rsp) movq64(%rdi), %rax cmpq%rax, -16(%rsp) je .L2 movq16(%rdi), %xmm0 .L3: movq%xmm0, 8(%rdi) movhps -16(%rsp), %xmm0 movups %xmm0, 24(%rdi) movq-16(%rsp), %xmm0 movq%rax, -16(%rsp) movhps -16(%rsp), %xmm0 movzbl %sil, %eax movups %xmm0, 40(%rdi) ret .L2: movq56(%rdi), %rcx movq%rcx, -16(%rsp) movq-16(%rsp), %xmm0 punpcklqdq %xmm0, %xmm0 movups %xmm0, 8(%rdi) movq-16(%rsp), %xmm0 jmp .L3 in the end it's a matter of properly cost-modelling this and not making a mess out of it during RTL expansion / optimization.
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 --- Comment #1 from acsawdey at gcc dot gnu.org --- Note that compiling with -fno-tree-slp-vectorize results in this much better code: _IO_new_file_overflow: ld 9,8(3) ld 10,64(3) cmpld 7,9,10 beq 7,.L2 ld 8,16(3) std 9,40(3) std 9,32(3) std 10,48(3) std 8,8(3) std 8,24(3) rlwinm 3,4,0,0xff blr .p2align 4,,15 .L2: ld 9,56(3) std 10,48(3) mr 8,9 std 9,16(3) std 9,40(3) std 9,32(3) std 8,8(3) std 8,24(3) rlwinm 3,4,0,0xff blr
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 Bill Schmidt changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |wschmidt at gcc dot gnu.org Target Milestone|--- |7.2
[Bug target/80695] gratuitous use of stxvx to store multiple pointers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80695 Bill Schmidt changed: What|Removed |Added Target Milestone|7.2 |8.0