Page MenuHomePhabricator

[CSKY 7/n] Initial codegen support for ALU operations
Needs ReviewPublic

Authored by zixuan-wu on Jan 20 2021, 2:49 AM.

Details

Summary

It cooks the minimal patch to construct the codegen infra for CSKY and generate the first basic ALU operation add and related test.
Next, all basic integer instruction codegen will follow.

Diff Detail

Event Timeline

zixuan-wu created this revision.Jan 20 2021, 2:49 AM
zixuan-wu requested review of this revision.Jan 20 2021, 2:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2021, 2:49 AM
myhsu added inline comments.Jan 20 2021, 10:35 PM
llvm/lib/Target/CSKY/CMakeLists.txt
26

(nit) sorting

llvm/lib/Target/CSKY/CSKYAsmPrinter.h
35

remove this comment please

Some comments, mostly on style, but this looks like a fair skeleton lowering to me.

The test shows the back-end recognising the calling convention registers from both arguments and return values and using the right instruction.

This looks good to me as a good seed to start adding more instructions.

llvm/lib/Target/CSKY/CSKYISelLowering.cpp
146

Are you expecting more behaviour here? This is a weird idiom to just assert if the CC isn't C or Fast.

248

va_arg is not supported yet, right? Maybe an assert here or when lowering the arguments.

llvm/lib/Target/CSKY/CSKYMCInstLower.cpp
26
llvm/lib/Target/CSKY/CSKYMCInstLower.h
28