[llvm-dev] How to implement lowerReturn for poring GlobalISel to RISCV?

Alex Bradbury via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 21 02:11:05 PST 2017


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


More information about the llvm-dev mailing list