On 6/30/26 3:35 AM, Robin Dapp wrote:
Hi,

When the reference operand for a dependent filters is not yet chosen, we
currently just allow everything.  This can lead to situations where we
fix a hard reg early, only for it to be rejected later.  That's
unreasonable and cannot be salvaged by lra.

This patch gives the filter a chance to reject early in this situation
and documents that IVNALID_REGNUM can be passed to dependent filters.
It also implements Stefan's suggestion to look through subregs before
filtering.

The issue became apparent when Pan tried refining riscv's widen_overlap_ok
filter function and made it very strict.  Right now, we still return true,
i.e. allow everything when the referenced op is not a hard reg.
This causes a situation where we first allow a hard regno (even though we
could decline it with the information passed with this patch), and later
reject because the chosen reference op prevents all other legal allocations.

Bootstrapped and regtested on x86, power10, and aarch64.
Regtested on riscv64.

OK for me.


Reply via email to