[PATCH] Remove redundent register mov by improving TwoAddressInstructionPass

Chandler Carruth chandlerc at gmail.com
Tue Feb 24 17:17:30 PST 2015


Minor style comments only.


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:314-315
@@ -311,1 +313,4 @@
 
+// getSingleDef -- return the MachineInstr* if it is the single def of the Reg
+// in current BB.
+static MachineInstr* getSingleDef(unsigned Reg, MachineBasicBlock *BB,
----------------
Please use our modern doxygen comment style for new code. (I know a bunch of old code doesn't)

http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments

================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:340-341
@@ +339,4 @@
+  unsigned TmpReg = FromReg;
+  // We set Length to 3 for now, which covers the common cases we see. Set the
+  // Length limit is to avoid endless searching in a copy chain loop.
+  int Length = 3;
----------------
It would be good to document your idea for how to handle this more generally in a FIXME here and maybe file a PR to track it?

http://reviews.llvm.org/D7806

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list