Hello, I am learning to write a new backend for LLVM and have a few simple questions.<br><br>1) What are the differences between 'constant' and 'targetconstant', 'globaladdress' and 'targetglobaladdress'? It is not clear from the document when and which should be used.<br>
<br>2) On the processor I am working on, there is a 'move reg, mem_addr' instruction. <br><br>When I try to match it using the pattern  [(set Int32Regs::reg, tglobaladdr::mem_addr)]. the code generated by tblgen cannot be compiled because there will be a switch statement that contains two cases for the 'tglobaladdr', one is hard-coded in by tblgen and the other is generated by tbglen following the pattern I specified. The compilation fails because of the two duplicated and conflicting cases.<br>
<br>When I try to match it using the pattern [(set Int32Regs::reg, globaladdr::mem_addr)], the corresponding DAG node generated does not take the mem_addr as an input. As a matter of fact, it takes itself as an input and forms cycle. <br>
<br>I am not sure if I explain the problems clearly.  I can certainly provide more information if needed.<br><br>Thank you in advance.<br><br>P.B.<br><br>