<div dir="ltr"><div>It appears that it's impossible to duplicate a node in the dag. For example, there is some code:</div><div><br></div><div>b = a * a; // a is a  global int</div><div><br></div><div>A LD node is generated for A and it goes into both Operand 0 and 1 of the MUL node. The issue is I'm trying to match a pattern of:</div><div><br></div><div>set dstReg:$dstD  (OpNode (srcAType (load addr32:$srcA)), (srcBType (load addr32:$srcB)))</div><div><br></div><div>so basically a mem, mem, reg operation.</div><div><br></div><div>The issue is this pattern won't match in the above example because there is only one LD generated for 'a'. I tried to duplicate the LD in the dag but it doesn't show up, it always reduces it to only one LD no matter what, even if I have multiple loads in the IR also.</div><div><br></div><div>#1. Is it possible to duplicate an exact copy of a node in the dag?</div><div>#2. How would I go about matching this pattern in table gen?</div><div><br></div><div>Thanks.</div></div>