This is an archive of the discontinued LLVM Phabricator instance.

[CSKY 9/n] Initial codegen support for ALU operations
AbandonedPublic

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
zixuan-wu retitled this revision from [CSKY 7/n] Initial codegen support for ALU operations to [CSKY 9/n] Initial codegen support for ALU operations.Apr 22 2021, 1:23 AM
myhsu added inline comments.Apr 22 2021, 10:05 AM
llvm/lib/Target/CSKY/CMakeLists.txt
28

Since you use functionalities from the CSKYDesc library (i.e. stuff from your MCTargetDesc folder), you need to link it explicitly. Otherwise the build might fail if you build LLVM libraries as shared objects

zixuan-wu abandoned this revision.Jul 28 2021, 2:21 AM

Because of out-of-date.