[PATCH] D79864: [PowerPC] Add new linker optimization for PowerPC

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 15:16:32 PDT 2020


amyk added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp:95
 
+  unsigned LastOp = MI->getNumOperands()-1;
+  if (MI->getNumOperands() > 1) {
----------------
Maybe add a short comment here about the relocation printing, since other cases are also documented.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrPrefix.td:504
+  let isNotDuplicable = 1,isCodeGenOnly = 1, mayLoad = 1, mayStore = 0 in {
+    def PLDpcnocopy :PPCEmitTimePseudo<(outs g8rc:$RT),
+                                       (ins memri34_pcrel:$D_RA),
----------------
nit: space after the `:`.


================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:405
+        // The use of this register must be as part of the address and not
+        // part of operand zero of a store.
+        if (ResultOp == Use.getOperand(0).getReg())
----------------
Would it be good to check if it is indeed a store instruction? Something like `Use.mayStore()`, though I realize it might be a bit redundant if we reached this part of the code.


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

https://reviews.llvm.org/D79864





More information about the llvm-commits mailing list