[llvm-dev] Operand does not exist in operand list
Craig Topper via llvm-dev
llvm-dev at lists.llvm.org
Tue Oct 16 17:51:22 PDT 2018
You need a register in the outs list too. To inform everything that your
instruction produces an output. And it needs to be a different name than
$ra and $rb. So let's say $rd for destination. You need to do this:
let Constraints = "$ra = $rd"
def ADDR : F_R<0b000000,(outs CPURegs:$rd) , (ins CPURegs:$rb,
CPURegs:$ra),"ADDR $ra, $rb",[(set CPURegs:$rd, (add CPURegs:$ra,
CPURegs:$rb))] >;
The Constraints line will tell the register allocation system that $ra and
$rd should always be the same physical register.
~Craig
On Tue, Oct 16, 2018 at 5:30 PM m m via llvm-dev <llvm-dev at lists.llvm.org>
wrote:
> Hi,
>
> Absolute LLVM newbie here. I am trying to define an add instruction which
> takes 2 register inputs ra and rb and writes the sum into ra.
>
>
> def ADDR : F_R<0b000000,(outs) , (ins CPURegs:$rb, CPURegs:$ra),"ADDR $ra,
> $rb",[(set CPURegs:$ra, (add CPURegs:$ra, CPURegs:$rb))] >;
>
>
> I get this error:
> error: In ADDR: Operand $rb does not exist in operand list!
>
>
> Does anybody know what that means?
>
> Thanks.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181016/6635a9d1/attachment.html>
More information about the llvm-dev
mailing list