[PATCH] D66329: [PowerPC] [Peephole] fold frame offset by using index form to save add.

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 21:07:12 PDT 2019


amyk added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2549
+//
+// new ADDI instr: ToBeChangedReg = ADDI FraemBaseReg, (OffsetAddi + OffsetImm)
+// Index instr:    Reg            = opx ScaleReg, ToBeChangedReg(killed)
----------------
`FraemBaseReg` -> `FrameBaseReg`


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2677
+  assert((UseOpIdx == 1 || UseOpIdx == 2) &&
+         "wrong operand index of add instruction");
+
----------------
nit: Capitalize the `W` on `wrong`.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2706
+
+  if (!III.IsSummingOperands)
+    return false;
----------------
This may be a silly question, but I am curious as to what this line means.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:2713
+
+  assert(MI.getOperand(III.OpNoForForwarding).isReg() &&
+         "Instruction format is not right");
----------------
`MI.getOperand(III.OpNoForForwarding)` is used a few times here, maybe it can be its own variable for more clarity?


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

https://reviews.llvm.org/D66329





More information about the llvm-commits mailing list