On 4/18/23 07:47, Jakub Jelinek wrote:
On Tue, Apr 18, 2023 at 07:35:44AM -0600, Jeff Law wrote:


On 4/18/23 03:06, Jakub Jelinek wrote:
Hi!

While we've agreed this is not the right fix for the PR109040 bug,
the patch clearly improves generated code (at least on the testcase from the
PR), so I'd like to propose this as optimization heuristics improvement
for GCC 14.

Ok for trunk?

2023-04-18  Jakub Jelinek  <ja...@redhat.com>

        PR target/109040
        * dse.cc (replace_read): If read_reg is a SUBREG of a word mode
        REG, for WORD_REGISTER_OPERATIONS copy SUBREG_REG of it into
        a new REG rather than the SUBREG.
Doesn't the new behavior need to be conditional on can_create_pseudos_p
since the call to copy_to_mode_reg can ultimately call gen_reg_rtx.

Why?  copy_to_mode_reg was used before as well and it unconditionally does
   rtx temp = gen_reg_rtx (mode);
as the first thing in the function.
So something must be guarding earlier, which is fine. It was a general question as it wasn't obvious what would happen post-reload.

OK for the trunk.
jeff

Reply via email to