I can match an instruction whose result is always written to a specific register using set with that register as the first operand in the DAG pattern of the instruction. For example on the XCore the result of the the ldap instruction is written to R11 and used to match the tglobaladdr node as follows:
def LDAP_lu10 : _FLU10<
(outs),
(ins i32imm:$addr),
"ldap r11, $addr",
[(set R11, (pcrelwrapper tglobaladdr:$addr))]>;
Is there anyway to get the same effect using a Pat<>? I'm asking because I want to use the same instruction for the new tblockaddress node. This means I have two patterns I want to specify, only one of which can be placed on the instruction definition. I haven't been able to figure out how to specify one of these using Pat<>. I can make things work by using two instruction definitions for the same instruction (allowing me to specify both patterns), but I wanted to check whether there was a better solution than duplicating the instruction definition in the .td file.
Thanks,
Richard