[PATCH] D92479: [RISCV] remove redundant instruction when eliminate frame index

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 22:54:38 PST 2020


kito-cheng added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp:174
     TII->movImm(MBB, II, DL, ScratchReg, Offset);
+    if (MI.getOpcode() == RISCV::ADDI) {
+      BuildMI(MBB, II, DL, TII->get(RISCV::ADD), MI.getOperand(0).getReg())
----------------
Just curios, does it possible get any other opcode than ADDI? below code are just update `Offset`, I guess that means we already assume it must be ADDI here? But I could be wrong since I didn't seriously tracing here before.

If my assumption is right then the code could be further simplified?  


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

https://reviews.llvm.org/D92479



More information about the llvm-commits mailing list