On Tue, Oct 22, 2024 at 7:31 PM Takayuki 'January June' Suwa
<jjsuwa_sys3...@yahoo.co.jp> wrote:
>
> In commit bc5a9dab55d13f888a3cdd150c8cf5c2244f35e0 ("gcc: xtensa: reorder
> movsi_internal patterns for better code generation during LRA"),  the
> instruction order in "movsi_internal" MD definition was changed to make LRA
> use load/store instructions with larger memory address displacements, but as
> a side effect, it now uses the larger displacements (ie., the larger
> instructions) even outside of reload operations.
>
> The underlying problem is that LRA assumes by default that there is only one
> maximal legitimate displacement for the same address structure, meaning that
> it has no choice but to use the first load/store instruction it finds.
>
> To fix this, define TARGET_DIFFERENT_ADDR_DISPLACEMENT_P hook to always
> return true.
>
> gcc/ChangeLog:
>
>         * config/xtensa/xtensa.cc (TARGET_DIFFERENT_ADDR_DISPLACEMENT_P):
>         Add new target hook to always return true.
>         * config/xtensa/xtensa.md (movsi_internal):
>         Revert the previous changes.
> ---
>   gcc/config/xtensa/xtensa.cc |  3 +++
>   gcc/config/xtensa/xtensa.md | 12 ++++++------
>   2 files changed, 9 insertions(+), 6 deletions(-)

Regtested for target=xtensa-linux-uclibc, no new regressions.
Committed to master

-- 
Thanks.
-- Max

Reply via email to