Some backends, RISC-V included, wrap shift counts in subreg which
current cond zero arith wasn't handling.
This came up up when looking at the original submission of cond zero
arith which did handle subregs but then was omitted to for initial
simplicity and then got lost along the way.
gcc/ChangeLog:
* ifcvt.cc (get_base_reg): Handle subreg.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/zicond_ifcvt_opt.c: Adjust increased czero counts.
Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
{
if (REG_P (exp))
return exp;
+ else if (SUBREG_P (exp))
+ return SUBREG_REG (exp);
return NULL_RTX;
}
x = z & x;
return x;
}
-/* { dg-final { scan-assembler-times {czero\.eqz} 36 } } */
+/* { dg-final { scan-assembler-times {czero\.eqz} 41 } } */
/* { dg-final { scan-assembler-times {czero\.nez} 36 } } */