On 6/12/23 01:41, Manolis Tsamis wrote:
I also think that's where this should end up since most of the pass is
target independent anyway.
I just couldn't figure out what would be a proper way to model the
propagation rules for each target.
Is a target hook necessary for that?
No hook should be necessary. You're already checking that the result is
recognized. In theory you shouldn't have to, but checking the
constraints seems advisable as well.
Costing is a different matter. You might end changing an offset in such
a way as to create a longer instruction on targets that have variable
length encoding. If we see that we'll likely have to add some rtx cost
calls and compare the before/after.
But I suspect those cases are going to be limited in practice and in
general if we're able to delete an earlier instruction we going to win
even if the offset in the MEM changes and perhaps even results in a
longer instruction.
Jeff