[PATCH] D34511: [mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 05:17:21 PDT 2017


sdardis added inline comments.


================
Comment at: lib/Target/Mips/MicroMipsSizeReduction.cpp:426
+  if (OpTransfer == OT_OperandsAll) {
+    DEBUG(dbgs() << "Converted 32-bit: " << *MI);
+    MI->setDesc(MipsII->get(Entry.NarrowOpc()));
----------------
This is common between the two branches of the if, so it can be hoisted above the if.


================
Comment at: lib/Target/Mips/MicroMipsSizeReduction.cpp:429
+    DEBUG(dbgs() << "       to 16-bit: " << *MI);
+    ++NumReduced;
+    return true;
----------------
This is common too, so it should be hoisted up.


================
Comment at: lib/Target/Mips/MicroMipsSizeReduction.cpp:462-463
   // microMIPS32r6 and microMIPS64r6
-  if (!Subtarget->inMicroMipsMode() || !Subtarget->hasMips32r2())
+  if (!Subtarget->inMicroMipsMode() || !Subtarget->hasMips32r2()
+      || Subtarget->hasMips32r6())
     return false;
----------------
Formatting: Break overly long conditional statements _after_ the '||' or '&&' operators, not before. i.e. This should be:

   if (!Subtarget->inMicroMipsMode() || !Subtarget->hasMips32r2() ||
       Subtarget->hasMips32r6())

clang-format handles this.


https://reviews.llvm.org/D34511





More information about the llvm-commits mailing list