<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hello.</div><div><br></div><div>In my backend I have pointers in different address spaces. I want to emit different instructions based on addrspace value, but I can't find a way to do that.</div><div><br></div><div>It seems not possible to do that with usual "store" pattern fragment in .td file, so I added custom ISD opcode for my instruction and created it manually in MyBackendISelLowering. However, it doesn't get selected now, no matter what I try.</div><div><br></div><div>The code I currently have in InstrInfo.td:</div><div><br></div><div>def my_store         : SDNode<"MYISD::STORE"      , SDTStore,<br>                        [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>;</div><div><br></div><div>let mayStore = 1 in {<br>def MyStore : InstMyRI<2, (outs), (ins i32imm:$i, IntRegs:$reg),<br>                     "", [(my_store i32:$reg, imm:$i)]>;<br>}</div><div><br></div><div>The error I get:</div><div><br></div><div>ISEL: Starting selection on root node: t15: ch = <<Unknown Target Node #278>> t13:1, Constant:i32<5>, FrameIndex:i32<-3><br>ISEL: Starting pattern match<br>  Initial Opcode index to 4<br>  Match failed at index 10<br>LLVM ERROR: Cannot select: t15: ch = <<Unknown Target Node #278>> t13:1, Constant:i32<5>, FrameIndex:i32<-3><br>  t2: i32 = Constant<5><br>  t14: i32 = FrameIndex<-3></div><div><br></div><div><br></div><div>Thanks in advance for your help.</div></div></div></div></div>