On 12/20/10 07:33, Mohamed Shafi wrote:

    I didn't know that you could do that in TARGET_SECONDARY_RELOAD
hook. Can you point me to some target that does this - figuring out
what the destination is based on the source or vice versa. In my case
only the address operand comes into TARGET_SECONDARY_RELOAD hook
during the reload pass. I am not sure how to find out the source for
the pattern which has this particular address as the destination.
The vast majority of targets define secondary reloads. You'd have to scan through them to see if one does precisely what you want -- I don't know if one will do precisely what you want, but there should be enough examples that you can learn from to implement what your target needs.

The mn103 port is pretty simple and defines a few well understood secondary reloads.

The other, less desirable alternative would be to disallow constant stores to memory completely in the insn predicate, then have a peephole2 to catch cases where you have a constant load into a reg followed by a store of that reg to a symbolic memory location and the reg dies.

jeff


Reply via email to