public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug middle-end/100951] New: vec_duplicate<mode> leads to worse code @ 2021-06-07 20:08 hjl.tools at gmail dot com 2021-06-08 7:52 ` [Bug middle-end/100951] " rguenth at gcc dot gnu.org ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: hjl.tools at gmail dot com @ 2021-06-07 20:08 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100951 Bug ID: 100951 Summary: vec_duplicate<mode> leads to worse code Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: rguenther at suse dot de Target Milestone: --- After I added ;; Modes handled by broadcast patterns. (define_mode_iterator INT_BROADCAST_MODE [(V64QI "TARGET_AVX512F") (V32QI "TARGET_AVX") V16QI (V32HI "TARGET_AVX512F") (V16HI "TARGET_AVX") V8HI (V16SI "TARGET_AVX512F") (V8SI "TARGET_AVX") V4SI (V8DI "TARGET_AVX512F") (V4DI "TARGET_64BIT") V2DI]) ;; Broadcast from an integer. NB: Enable broadcast only if we can move ;; from GPR to SSE register directly. */ (define_expand "vec_duplicate<mode>" [(set (match_operand:INT_BROADCAST_MODE 0 "register_operand") (vec_duplicate:INT_BROADCAST_MODE (match_operand:<ssescalarmode> 1 "nonimmediate_operand")))] "TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_TO_VEC" { ix86_expand_integer_vec_duplicate (operands); DONE; }) to x86 backend, I got [hjl@gnu-cfl-2 gcc]$ cat /tmp/x.c typedef short __attribute__((__vector_size__ (8 * sizeof (short)))) V; V v, w; void foo (void) { w = __builtin_shuffle (v != v, 0 < (V) {}, (V) {192} >> 5); } [hjl@gnu-cfl-2 gcc]$ ./xgcc -B./ -S /tmp/x.c [hjl@gnu-cfl-2 gcc]$ cat x.s .file "x.c" .text .globl v .bss .align 16 .type v, @object .size v, 16 v: .zero 16 .globl w .align 16 .type w, @object .size w, 16 w: .zero 16 .text .globl foo .type foo, @function foo: .LFB0: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 movl $0, %eax movd %eax, %xmm0 punpcklwd %xmm0, %xmm0 pshufd $0, %xmm0, %xmm0 movaps %xmm0, w(%rip) nop popq %rbp .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE0: .size foo, .-foo .ident "GCC: (GNU) 12.0.0 20210607 (experimental)" .section .note.GNU-stack,"",@progbits [hjl@gnu-cfl-2 gcc]$ since middld-end leaves us with an unfolded constant CTOR. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/100951] vec_duplicate<mode> leads to worse code 2021-06-07 20:08 [Bug middle-end/100951] New: vec_duplicate<mode> leads to worse code hjl.tools at gmail dot com @ 2021-06-08 7:52 ` rguenth at gcc dot gnu.org 2021-06-08 8:48 ` cvs-commit at gcc dot gnu.org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: rguenth at gcc dot gnu.org @ 2021-06-08 7:52 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100951 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Last reconfirmed| |2021-06-08 Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Testing patch. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/100951] vec_duplicate<mode> leads to worse code 2021-06-07 20:08 [Bug middle-end/100951] New: vec_duplicate<mode> leads to worse code hjl.tools at gmail dot com 2021-06-08 7:52 ` [Bug middle-end/100951] " rguenth at gcc dot gnu.org @ 2021-06-08 8:48 ` cvs-commit at gcc dot gnu.org 2021-06-08 8:48 ` rguenth at gcc dot gnu.org 2021-09-17 6:48 ` pinskia at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2021-06-08 8:48 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100951 --- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:ffe3a37f54ab866d85bdde48c2a32be5e09d8515 commit r12-1280-gffe3a37f54ab866d85bdde48c2a32be5e09d8515 Author: Richard Biener <rguenther@suse.de> Date: Mon Jun 7 20:08:13 2021 +0200 middle-end/100951 - make sure to generate VECTOR_CST in lowering When vector lowering creates piecewise ops make sure to create VECTOR_CSTs instead of CONSTRUCTORs when possible. gcc/ 2021-06-07 Richard Biener <rguenther@suse.de> PR middle-end/100951 * tree-vect-generic.c (expand_vector_piecewise): Build a VECTOR_CST if all elements are constant. (expand_vector_condition): Likewise. (lower_vec_perm): Likewise. (expand_vector_conversion): Likewise. gcc/testsuite/ 2021-06-07 H.J. Lu <hjl.tools@gmail.com> PR middle-end/100951 * gcc.target/i386/pr100951.c: New test. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/100951] vec_duplicate<mode> leads to worse code 2021-06-07 20:08 [Bug middle-end/100951] New: vec_duplicate<mode> leads to worse code hjl.tools at gmail dot com 2021-06-08 7:52 ` [Bug middle-end/100951] " rguenth at gcc dot gnu.org 2021-06-08 8:48 ` cvs-commit at gcc dot gnu.org @ 2021-06-08 8:48 ` rguenth at gcc dot gnu.org 2021-09-17 6:48 ` pinskia at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: rguenth at gcc dot gnu.org @ 2021-06-08 8:48 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100951 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|ASSIGNED |RESOLVED --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Fixed. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/100951] vec_duplicate<mode> leads to worse code 2021-06-07 20:08 [Bug middle-end/100951] New: vec_duplicate<mode> leads to worse code hjl.tools at gmail dot com ` (2 preceding siblings ...) 2021-06-08 8:48 ` rguenth at gcc dot gnu.org @ 2021-09-17 6:48 ` pinskia at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-09-17 6:48 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100951 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Target Milestone|--- |12.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-09-17 6:48 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-06-07 20:08 [Bug middle-end/100951] New: vec_duplicate<mode> leads to worse code hjl.tools at gmail dot com 2021-06-08 7:52 ` [Bug middle-end/100951] " rguenth at gcc dot gnu.org 2021-06-08 8:48 ` cvs-commit at gcc dot gnu.org 2021-06-08 8:48 ` rguenth at gcc dot gnu.org 2021-09-17 6:48 ` pinskia at gcc dot gnu.org
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).