<div dir="ltr">Hi everyone,<div><br></div><div>I am working on a new backend and I am having an odd problem with the CodeGenEmitter (trying to create GenCodeEmitter.inc) when defining the "return" instruction of this architecture. I have followed other backends, however, that did not solve it. </div><div><br></div><div>The "Return" instruction is defined as follows.</div><div><br></div><div><div>def Ret : SDNode<"ArchISD::RET", SDTNone,</div><div> [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;</div></div><div><br></div><div><div>class ReturnInstr<string OpcStr, bits<8> OpVal, InstrItinClass Itin></div><div> : InstArch<(outs), (ins),</div><div> OpcStr,</div><div> [(Ret)], Itin>{</div><div> let isReturn = 1;</div><div>}</div></div><div>
<p class=""><span class="">def RET : ReturnInstr<</span><span class="">"return"</span><span class="">, </span><span class="">0</span><span class="">b00100110, IIAlu>;</span></p><p class=""><span class=""><br></span></p></div><div>And the error is the following.</div><div>
<p class=""><b>Assertion failed: (i < OperandList.size() && "Invalid flat operand #"), function getSubOperandNumber, file llvm/utils/TableGen/CodeGenInstruction.h, line 186.</b></p>
<p class=""><br></p></div><div>The odd thing is: this is similar to other architectures.</div><div><br></div><div>It looks like I cannot make an instruction to be <b>SDTNone (no Ins)</b>, since it worked when I changed this instruction by adding an Input DAG in it (that is not what I want, though).</div><div><br></div><div>Any thoughts? Am I missing something?</div><div><br></div><div><br></div><div>Thanks,</div><div>Tiago</div></div>