<div style="font-size: 12pt; font-family: Calibri,sans-serif;"><div>Hi,</div><div>You're probably going to want to create your own node and then do some custom lowering in your TargetLowering class. Then you can use DAG to DAG. Check out the ARM and x86 backends for plenty of examples.</div><div><br></div><div>Good luck,</div><div>Sam</div><div><br></div><div>Sam Parker</div><div>Research Student</div><div>Electronic Systems Design Group</div><div>School of Electronic, Electrical and Systems Engineering</div><div>Loughborough University</div><br><div id="htc_header">----- Reply message -----<br>From: "deadal nix" <deadalnix@gmail.com><br>To: <llvmdev@cs.uiuc.edu><br>Subject: [LLVMdev] Partial instruction match in the backend<br>Date: Sat, May 10, 2014 02:12</div></div><br><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I'm trying to generate DAG to DAG with several instructions that are variadic in their input and output.<br><br></div>As far as I can tell, tablegen do not provide anything for me to match these variadic outputs. However, it can match the input quite nicely.<br>

<br></div>My initial idea was to call Select to let tablegen match the node, and then fix the outs of the matched instruction. However, it look like tablegen generated matching code try to substitute the old node with the matched one immediately, which result in error as the node do not have the right outputs. Is there a way to say to tablegen "hey, match this node, but don't substitute, I have extra work to do", and if not, how difficult would it be to create one ? Can someone give me some pointers ?<br>

<br></div>The second approach I've tried is to match completely with custom code. This seems like a lot of unnecessary work, and if matching constants arguments and alike is simple, I'm not sure what i'm supposed to do when argument are themselves can be the result of any kind of computation that must be matched ? What would be the code match a add manually for instance ? Is there something I can look at in some backend ?<br>

<br></div>Thank by advance for any help you can provide.<br></div>