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