[PATCH] D95030: [CSKY 7/n] Initial codegen support for ALU operations

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 09:21:00 PST 2021


rengolin added a comment.

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.



================
Comment at: llvm/lib/Target/CSKY/CSKYISelLowering.cpp:146
+
+  switch (CallConv) {
+  default:
----------------
Are you expecting more behaviour here? This is a weird idiom to just assert if the CC isn't `C` or `Fast`.


================
Comment at: llvm/lib/Target/CSKY/CSKYISelLowering.cpp:248
+  if (IsVarArg)
+    return CC_CSKY_ABIV2_VARARG;
+
----------------
va_arg is not supported yet, right? Maybe an assert here or when lowering the arguments.


================
Comment at: llvm/lib/Target/CSKY/CSKYMCInstLower.cpp:26
+
+void CSKYMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
+  OutMI.setOpcode(MI->getOpcode());
----------------



================
Comment at: llvm/lib/Target/CSKY/CSKYMCInstLower.h:28
+
+  void Lower(const MachineInstr *MI, MCInst &OutMI) const;
+  bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const;
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95030/new/

https://reviews.llvm.org/D95030



More information about the llvm-commits mailing list