On 8/1/23 05:18, Richard Sandiford wrote:

Where were you seeing the requirement for pointer equality?  genrecog.cc
at least uses rtx_equal_p, and I think it has to.  E.g. some patterns
use (match_dup ...) to match output and input mems, and mem rtxes
shouldn't be shared.
It's a general concern due to the way we handle transforming pseudos into hard registers after allocation is complete. We can end up with two REG expressions that will compare equal according to rtx_equal_p, but which are not pointer equal.

For this kit I think the worst that would happen would be a failure to optimize cases post-reload. But it's still good RTL hygene IMHO.




I'd always understood using matching constraints against other inputs
to be a no-no, since the RA doesn't (and can't reasonably be expected to)
make two non-identical inputs match.  So AIUI, using "1" won't lead to
different code generation compared to "r".  Both are relying on the RA
happening to do the right thing.  But "1" would presumably trigger an
ICE if something goes wrong.
Yea, I think you're right. The constraint isn't terribly important for these patterns -- the condition is really the enforcement mechanism.

Jeff

Reply via email to