On Mon, Jul 18, 2022 at 5:47 AM Takayuki 'January June' Suwa <jjsuwa_sys3...@yahoo.co.jp> wrote: > > This patch corrects the overestimation of the relative cost of > '(set (reg) (const_int N))' where N fits into the instruction itself. > > In fact, such overestimation confuses the RTL loop invariant motion pass. > As a result, it brings almost no negative impact from the speed point of > view, but addtiional reg-reg move instructions and register allocation > pressure about the size. > ... > gcc/ChangeLog: > > * config/xtensa/xtensa.cc (xtensa_rtx_costs): > Change the relative cost of '(set (reg) (const_int N))' where > N fits into signed 12-bit from 4 to 0 if optimizing for size. > And use the appropriate macro instead of the bare number 4. > --- > gcc/config/xtensa/xtensa.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)
Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max