[PATCH] Remove redundent register mov by improving TwoAddressInstructionPass

David Majnemer david.majnemer at gmail.com
Tue Feb 24 23:03:34 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:316
@@ +315,3 @@
+/// in current BB.
+static MachineInstr* getSingleDef(unsigned Reg, MachineBasicBlock *BB,
+                                  const MachineRegisterInfo *MRI) {
----------------
Please use `MachineInstr *` instead of `MachineInstr*`.

================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:318
@@ +317,3 @@
+                                  const MachineRegisterInfo *MRI) {
+  MachineInstr *ret = NULL;
+  for (MachineOperand &MO : MRI->reg_operands(Reg)) {
----------------
Variable names are capitalized.

================
Comment at: lib/CodeGen/TwoAddressInstructionPass.cpp:327
@@ +326,3 @@
+      else if (ret != MI)
+        return NULL;
+    }
----------------
nullptr

http://reviews.llvm.org/D7806

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






More information about the llvm-commits mailing list