On Tue, 2021-01-19 at 09:41 +0100, Richard Biener wrote: > On Mon, Jan 18, 2021 at 11:04 PM Ilya Leoshkevich via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > Suppose we have: > > > > (set (reg/v:TF 63) (mem/c:TF (reg/v:DI 62))) > > (set (reg:FPRX2 66) (subreg:FPRX2 (reg/v:TF 63) 0)) > > > > It is clearly profitable to propagate the first insn into the > > second > > one and get: > > > > (set (reg:FPRX2 66) (mem/c:FPRX2 (reg/v:DI 62))) > > > > fwprop actually manages to perform this, but doesn't think the > > result is > > worth it, which results in unnecessary store/load sequences on > > s390. > > Improve the situation by classifying SUBREG -> MEM changes as > > profitable. > > IIRC fwprop also propagates into multiple uses and replacing a non- > MEM > with a MEM is only good when the original MEM goes away - is that > properly > dealt with here?
This is because of efficiency and not correctness reasons, right? For c orrectness I already check MEM_VOLATILE_P (new_rtx). For efficiency I t hink it would be reasonable to add def_insn->num_uses () == 1 check (thi s passes my tests, I'm yet to do a full regtest though). What do you think about this?