On 12/28/2025 7:26 PM, Andrew Pinski wrote:
This fixes up a missed optimization regression for riscv in ifcvt after 
r16-6350-g9e61a171244110.
The problem is noce_emit_cmove will fail for QImode. This can show up when 
dealing with shifts
and the right hand side is `(subreg:QI (reg:DI) lowpart)`. Trying first for the 
subreg mode
fails so the need to try to unwrap the subreg and try for the full mode.

This fixes test_ShiftLeft_eqz in gcc.target/riscv/zicond_ifcvt_opt.c.

Bootstrapped and tested on x86_64-linux-gnu.

        PR rtl-optimization/123308
gcc/ChangeLog:

        * ifcvt.cc (noce_try_cond_zero_arith): If noce_emit_cmove fails
        for a lowpart subreg case, then try the full reg cmove and
        take the lowpart subreg afterwards.
OK.    It's a different approach than we'd taken internally, but I can't say the internal approach was any better.  Let's try yours and see where it takes us from a long term maintenance standpoint.

jeff

Reply via email to