[PATCH] D39688: [Nios2] final infrastructure addition to provide compilation of simple return from a function.

Andrei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 09:21:43 PST 2017


AndreiGrischenko added inline comments.


================
Comment at: lib/Target/Nios2/CMakeLists.txt:22
+ Nios2ISelDAGToDAG.cpp
  Nios2FrameLowering.cpp
+ Nios2ISelLowering.cpp
----------------
craig.topper wrote:
> Frame lowering should be above InstrInfo.cpp to be in alphabetical ordering
OK


================
Comment at: lib/Target/Nios2/InstPrinter/Nios2InstPrinter.cpp:29
+void Nios2InstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
+  OS << StringRef(getRegisterName(RegNo)).lower();
+}
----------------
craig.topper wrote:
> Are your register names not lowercase in the td file?
> 
> Though it seems several targets do this.
Yes, right, thanks. It is not necessary for Nios2 as all registers are in lowercase.


================
Comment at: lib/Target/Nios2/MCTargetDesc/CMakeLists.txt:2
 #MCTargetDesc / CMakeLists.txt
-add_llvm_library(LLVMNios2Desc Nios2MCTargetDesc.cpp)
+add_llvm_library(LLVMNios2Desc Nios2MCTargetDesc.cpp Nios2MCExpr.cpp
+                 Nios2MCAsmInfo.cpp Nios2TargetStreamer.cpp Nios2AsmBackend.cpp
----------------
craig.topper wrote:
> Can you put these on one line per file and alphabetize?
OK


================
Comment at: lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.cpp:51
+    if (TT.getArch() == Triple::nios2) {
+      if (CPU.empty() || CPU == "nios2r2") {
+        ArchFS = "+nios2r2";
----------------
craig.topper wrote:
> The if at line 49 check if CPU is empty or generic. There's no way to get here and the CPU be "nios2r2"
Yes, I reworked this routine.


https://reviews.llvm.org/D39688





More information about the llvm-commits mailing list