[llvm-dev] backend handles "return" instruction

Xiangyang Guo via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 12 21:38:57 PDT 2015


Hi,

I want to implement a backend. In my backend, there is no stack. For the
"return" instruction, if I have LLVM IR looks like this "%1 = add i32 %2,
%3" and "ret i32 %1". I hope my backend can print something like "add v1,
v2, v3" and "return v1". I checked some tutorials such as "OpenRISC",
"MSP430" and "LEG" backend, they all "return" to a particular register.
However, this is not what I want.

I appreciate it if you could any me any suggestion how to  handle the
"return" instruction here? I guess I need to change both InstInfo.td and
ISelLowing.cpp file. However, I have no idea right now.

Thanks,

Xiangyang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151013/2a612505/attachment.html>


More information about the llvm-dev mailing list