[PATCH] D17011: [lanai] Add Lanai backend.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 08:14:50 PDT 2016


t.p.northover accepted this revision.
t.p.northover added a comment.

I think I'm down to trivia too, and would be happy for you to commit without re-upload. Thanks for the many revisions!

Tim.


================
Comment at: lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp:193
@@ +192,3 @@
+
+  bool isBrTarget() { return isImm() || isToken(); }
+
----------------
There seems to be no validation of branch distance here (24-bits?).

================
Comment at: lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp:756
@@ +755,3 @@
+
+unsigned AluWithPrePost(unsigned AluCode, bool PreOp, bool PostOp) {
+  if (PreOp)
----------------
Global-scope functions should be static to avoid exporting unnecessary symbols unless you really expect them to be accessed from elsewhere (this is just the first one I noticed).

================
Comment at: lib/Target/Lanai/InstPrinter/LanaiInstPrinter.cpp:47
@@ +46,3 @@
+
+static bool UsesGivenOffset(const MCInst *MI, int AddOffset) {
+  unsigned AluCode = MI->getOperand(3).getImm();
----------------
Functions begin with lower case in LLVM (unless there's compelling surrounding code for consistency).

================
Comment at: lib/Target/Lanai/LanaiDelaySlotFiller.cpp:231-236
@@ +230,8 @@
+  // Add RCA to RegDefs to prevent users of RCA from going into delay slot.
+  if (MI->isCall())
+    RegDefs.insert(Lanai::RCA);
+
+  // Add RCA to RegUses to prevent definers of RCA from going into delay slot.
+  if (MI->isReturn())
+    RegUses.insert(Lanai::RCA);
+
----------------
Can't this be done in the .td file? "let Uses = [RCA]" (or Defs) on the instruction?


http://reviews.llvm.org/D17011





More information about the llvm-commits mailing list