Duplicate the range information of the phi onto the new ssa_name
authorAndrew Pinski <apinski@marvell.com>
Sat, 19 Jun 2021 17:08:21 +0000 (10:08 -0700)
committerAndrew Pinski <apinski@marvell.com>
Mon, 28 Jun 2021 10:06:37 +0000 (03:06 -0700)
commit9fe9c45ae33a2df7a73a7c8d9a92a649206a15b7
tree778d510089822a6b881d1d1c48691a14e10ea262
parentf80c4eaca0805bc9e68ed944519519c3dd1c12e1
Duplicate the range information of the phi onto the new ssa_name

Since match_simplify_replacement uses gimple_simplify, there is a new
ssa name created sometimes and then we go and replace the phi edge with
this new ssa name, the range information on the phi is lost.
Placing this in replace_phi_edge_with_variable is the best option instead
of doing it in each time replace_phi_edge_with_variable is called which is
what is done today.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Duplicate range
info if we're the only things setting the target PHI.
(value_replacement): Don't duplicate range here.
(minmax_replacement): Likewise.
gcc/tree-ssa-phiopt.c