Skip to content

Commit 4d24159

Browse files
rguenthRichard Biener
authored andcommitted
Preserve SSA info for more propagated copy
Besides VN and copy-prop also CCP and VRP as well as forwprop propagate out copies and thus it's worthwhile to try to preserve range and points-to info there when possible. Note that this also fixes the testcase from PR115701 but that's because we do not actually intersect info but only copy info when there was no info present. * tree-ssa-forwprop.cc (fwprop_set_lattice_val): Preserve SSA info. * tree-ssa-propagate.cc (substitute_and_fold_dom_walker::before_dom_children): Likewise.
1 parent 7a65ab6 commit 4d24159

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

gcc/tree-ssa-forwprop.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ fwprop_set_lattice_val (tree name, tree val)
207207
lattice.quick_grow_cleared (num_ssa_names);
208208
}
209209
lattice[SSA_NAME_VERSION (name)] = val;
210+
/* As this now constitutes a copy duplicate points-to
211+
and range info appropriately. */
212+
if (TREE_CODE (val) == SSA_NAME)
213+
maybe_duplicate_ssa_info_at_copy (name, val);
210214
}
211215
}
212216

gcc/tree-ssa-propagate.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,10 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
789789
fprintf (dump_file, "\n");
790790
}
791791
bitmap_set_bit (dceworklist, SSA_NAME_VERSION (res));
792+
/* As this now constitutes a copy duplicate points-to
793+
and range info appropriately. */
794+
if (TREE_CODE (sprime) == SSA_NAME)
795+
maybe_duplicate_ssa_info_at_copy (res, sprime);
792796
continue;
793797
}
794798
}
@@ -831,6 +835,10 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
831835
fprintf (dump_file, "\n");
832836
}
833837
bitmap_set_bit (dceworklist, SSA_NAME_VERSION (lhs));
838+
/* As this now constitutes a copy duplicate points-to
839+
and range info appropriately. */
840+
if (TREE_CODE (sprime) == SSA_NAME)
841+
maybe_duplicate_ssa_info_at_copy (lhs, sprime);
834842
continue;
835843
}
836844
}

0 commit comments

Comments
 (0)