On 4/1/25 9:35 PM, Jeff Law wrote:

Segher -- there's a combine question near the end...


On 3/23/25 8:43 PM, Bohan Lei wrote:
The combine pass can generate an index like (and:DI (mult:DI (reg:DI)
(const_int scale)) (const_int mask)) when XTheadMemIdx is available.
LRA may pull it out, and thus a splitter is needed when Zba is not
available.

A similar splitter were introduced when XTheadMemIdx support was added,
but removed in commit 31c3c5d.  The new splitter in this new patch is
based on the removed one.

gcc/ChangeLog:

         * config/riscv/thead.md (*th_memidx_operand): New splitter.

gcc/testsuite/ChangeLog:

         * gcc.target/riscv/xtheadmemidx-bug.c: New test.
So returning to this....

So the combine pass doesn't reject combination into an ASM_INPUT, just combination from most ASM_INPUTs.

It does rely on predicates to determine validity. So my suspicion is that the memory_operand (or one of the closely related) predicates is returning true for an addressing mode is that is not always valid.

Or to put it another way, addressing mode validity is based on two properties. The form of the address and the mode of the memory reference. If any other context is needed to determine validity, then that addressing format must not be considered valid for the given memory access mode.


I hope I didn't steer you the wrong way on that issue Christoph!

So at best this splitter is still just papering over a bigger problem that needs to be fixed.

Jeff

Reply via email to