public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4405] Avoid left around copies when value-numbering BBs
@ 2023-10-05 8:26 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-10-05 8:26 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b583a2940af90d03f535648fef111cb158933f7d
commit r14-4405-gb583a2940af90d03f535648fef111cb158933f7d
Author: Richard Biener <rguenther@suse.de>
Date: Wed Oct 4 15:25:33 2023 +0200
Avoid left around copies when value-numbering BBs
The following makes sure to treat values whose definition we didn't
visit as available since those by definition must dominate the entry
of the region. That avoids unpropagated copies after if-conversion
and resulting SLP discovery fails (which doesn't handle plain copies).
* tree-ssa-sccvn.cc (rpo_elim::eliminate_avail): Not
visited value numbers are available itself.
Diff:
---
gcc/tree-ssa-sccvn.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index e46498568cb..d2aab38c2d2 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -7688,7 +7688,11 @@ rpo_elim::eliminate_avail (basic_block bb, tree op)
{
if (SSA_NAME_IS_DEFAULT_DEF (valnum))
return valnum;
- vn_avail *av = VN_INFO (valnum)->avail;
+ vn_ssa_aux_t valnum_info = VN_INFO (valnum);
+ /* See above. */
+ if (!valnum_info->visited)
+ return valnum;
+ vn_avail *av = valnum_info->avail;
if (!av)
return NULL_TREE;
if (av->location == bb->index)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-05 8:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-05 8:26 [gcc r14-4405] Avoid left around copies when value-numbering BBs Richard Biener
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).