public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
@ 2021-04-27 11:38 ` jakub at gcc dot gnu.org
2021-07-28 7:04 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-27 11:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93080
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.0 |11.2
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.1 has been released, retargeting bugs to GCC 11.2.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
2021-04-27 11:38 ` [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized jakub at gcc dot gnu.org
@ 2021-07-28 7:04 ` rguenth at gcc dot gnu.org
2023-07-15 17:29 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28 7:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93080
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.2 |---
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
2021-04-27 11:38 ` [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized jakub at gcc dot gnu.org
2021-07-28 7:04 ` rguenth at gcc dot gnu.org
@ 2023-07-15 17:29 ` pinskia at gcc dot gnu.org
2023-08-21 14:32 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-15 17:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93080
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
Assignee|pinskia at gcc dot gnu.org |unassigned at gcc dot gnu.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2023-07-15 17:29 ` pinskia at gcc dot gnu.org
@ 2023-08-21 14:32 ` rguenth at gcc dot gnu.org
2023-08-22 9:34 ` cvs-commit at gcc dot gnu.org
2023-08-22 9:36 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-21 14:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93080
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
comment#4 could be implemented by an associating pattern in match.pd, currently
we get
a_3 = BIT_INSERT_EXPR <a_1(D), c_2(D), 32 (32 bits)>;
a_4 = VEC_PERM_EXPR <a_3, a_1(D), { 0, 1, 6, 3 }>;
associating a VEC_PERM_EXPR <a, b, { ... }> when a or b are defined as
insertion into b or a respectively so we get a permute of either a
or b with itself (and in this case it's a noop permute).
Of course with an arbitrary sequence of inserts / extracts / permutes
more "generic" association would be necessary and a pure implementation
in match.pd looks difficult.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2023-08-21 14:32 ` rguenth at gcc dot gnu.org
@ 2023-08-22 9:34 ` cvs-commit at gcc dot gnu.org
2023-08-22 9:36 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-22 9:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93080
--- Comment #8 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:27de9aa152141e7f3ee66372647d0f2cd94c4b90
commit r14-3381-g27de9aa152141e7f3ee66372647d0f2cd94c4b90
Author: Richard Biener <rguenther@suse.de>
Date: Wed Jul 12 15:01:47 2023 +0200
tree-optimization/94864 - vector insert of vector extract simplification
The PRs ask for optimizing of
_1 = BIT_FIELD_REF <b_3(D), 64, 64>;
result_4 = BIT_INSERT_EXPR <a_2(D), _1, 64>;
to a vector permutation. The following implements this as
match.pd pattern, improving code generation on x86_64.
On the RTL level we face the issue that backend patterns inconsistently
use vec_merge and vec_select of vec_concat to represent permutes.
I think using a (supported) permute is almost always better
than an extract plus insert, maybe excluding the case we extract
element zero and that's aliased to a register that can be used
directly for insertion (not sure how to query that).
The patch FAILs one case in gcc.target/i386/avx512fp16-vmovsh-1a.c
where we now expand from
__A_28 = VEC_PERM_EXPR <x2.8_9, x1.9_10, { 0, 9, 10, 11, 12, 13, 14, 15
}>;
instead of
_28 = BIT_FIELD_REF <x2.8_9, 16, 0>;
__A_29 = BIT_INSERT_EXPR <x1.9_10, _28, 0>;
producing a vpblendw instruction instead of the expected vmovsh. That's
either a missed vec_perm_const expansion optimization or even better,
an improvement - Zen4 for example has 4 ports to execute vpblendw
but only 3 for executing vmovsh and both instructions have the same size.
The patch XFAILs the sub-testcase.
PR tree-optimization/94864
PR tree-optimization/94865
PR tree-optimization/93080
* match.pd (bit_insert @0 (BIT_FIELD_REF @1 ..) ..): New pattern
for vector insertion from vector extraction.
* gcc.target/i386/pr94864.c: New testcase.
* gcc.target/i386/pr94865.c: Likewise.
* gcc.target/i386/avx512fp16-vmovsh-1a.c: XFAIL.
* gcc.dg/tree-ssa/forwprop-40.c: Likewise.
* gcc.dg/tree-ssa/forwprop-41.c: Likewise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2023-08-22 9:34 ` cvs-commit at gcc dot gnu.org
@ 2023-08-22 9:36 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-22 9:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93080
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
The testcase in the description is fixed, comment#2 and comment#4 are not.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-22 9:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-93080-4@http.gcc.gnu.org/bugzilla/>
2021-04-27 11:38 ` [Bug tree-optimization/93080] insert of an extraction on the same location is not optimized jakub at gcc dot gnu.org
2021-07-28 7:04 ` rguenth at gcc dot gnu.org
2023-07-15 17:29 ` pinskia at gcc dot gnu.org
2023-08-21 14:32 ` rguenth at gcc dot gnu.org
2023-08-22 9:34 ` cvs-commit at gcc dot gnu.org
2023-08-22 9:36 ` rguenth 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).