Avoid left around copies when value-numbering BBs
Checks
Commit Message
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).
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
* tree-ssa-sccvn.cc (rpo_elim::eliminate_avail): Not
visited value numbers are available itself.
---
gcc/tree-ssa-sccvn.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -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)