[PATCH] D39848: [RISCV] Support lowering FrameIndex

Ana Pazos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 17:24:35 PST 2017


apazos added inline comments.


================
Comment at: lib/Target/RISCV/RISCVISelDAGToDAG.cpp:94
+  FrameIndexSDNode *FIN = nullptr;
+  if ((FIN = dyn_cast<FrameIndexSDNode>(Addr))) {
+    Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
----------------
too many ( )


================
Comment at: lib/Target/RISCV/RISCVRegisterInfo.cpp:90
+  } else {
+    FrameReg = getFrameRegister(MF);
+  }
----------------
you can make this the default value and eliminate the else.


================
Comment at: lib/Target/RISCV/RISCVRegisterInfo.cpp:122
+    break;
+  default:
+    llvm_unreachable("Unexpected opcode");
----------------
maybe move default to the first check.


https://reviews.llvm.org/D39848





More information about the llvm-commits mailing list