https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61110
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 58089 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58089&action=edit Start of rewriting value_replacement to use match-and-simplify This is a start and does not remove the old code. It has a few small regressions due to not being able to merge the bb when doing the replacement. this is something which I am working on but I am posting it here as I stopping to work on this for a month or so but will come back to it.