Alex Bradbury via llvm-dev
2017-Dec-21 10:11 UTC
[llvm-dev] How to implement lowerReturn for poring GlobalISel to RISCV?
On 21 December 2017 at 09:05, Leslie Zhai <lesliezhai at llvm.org.cn> wrote:> Hi Alex, > > Thanks for your teaching! > > I only implemented GlobalISel skeleton for RISCV target, built with no > errors, is it suitable to review code now as Initial porting or wait for > more APIs (for example: lowerReturn, getStackAddress) implemented?>From my perspective, I think it would be useful to get a little moreconfidence about what you've implemented by at least adding support for lowering simple ALU operations. That would make it easier for someone who isn't an expert in GlobalISel (such as me) to review.> I use `a return from a void function` testcase: ><snip>Based on your follow-up message, it seems you got this working. Although comparing to gcc can be useful, I'd suggest that comparing to RISC-V SelectionDAGISel may be more useful. e.g. just using llc and -print-after-all or -debug-only=isel to see how the current codegen works. The existing tests in test/Codegen/RISCV should also be useful. Best, Alex
Leslie Zhai via llvm-dev
2017-Dec-26 07:50 UTC
[llvm-dev] How to implement lowerReturn for poring GlobalISel to RISCV?
Hi Alex, Sorry to bother you for the holidays! I am stuck at CC_RISCV[1] you removed RetCC_RISCV32 and CC_RISCV32 from RISCVCallingConv.td and implemented a custom calling convention[2] function owing to TableGen-based calling convention definitions to lack flexibility and require substantial boilerplate when you reach their limitations. I asked the similar question[3] in the mailing list before, and Diana suggested that having a CCAssignFn available would make it easier to use the existing infrastructure. Because ValueHandler needs a CCAssignFn varaible for handling return not void value in lowerReturn. Please lead me to give me some direction, thanks a lot! [1] https://reviews.llvm.org/D39898 [2] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#procedure-calling-convention [3] http://lists.llvm.org/pipermail/llvm-dev/2017-November/119357.html 在 2017年12月21日 18:11, Alex Bradbury 写道:> On 21 December 2017 at 09:05, Leslie Zhai <lesliezhai at llvm.org.cn> wrote: >> Hi Alex, >> >> Thanks for your teaching! >> >> I only implemented GlobalISel skeleton for RISCV target, built with no >> errors, is it suitable to review code now as Initial porting or wait for >> more APIs (for example: lowerReturn, getStackAddress) implemented? > From my perspective, I think it would be useful to get a little more > confidence about what you've implemented by at least adding support > for lowering simple ALU operations. That would make it easier for > someone who isn't an expert in GlobalISel (such as me) to review. > >> I use `a return from a void function` testcase: >> <snip> > Based on your follow-up message, it seems you got this working. > Although comparing to gcc can be useful, I'd suggest that comparing to > RISC-V SelectionDAGISel may be more useful. e.g. just using llc and > -print-after-all or -debug-only=isel to see how the current codegen > works. The existing tests in test/Codegen/RISCV should also be useful. > > Best, > > Alex-- Regards, Leslie Zhai - https://reviews.llvm.org/p/xiangzhai/