[PATCH] D16203: [AArch64] Add pass to remove redundant copy after RA

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 11:40:00 PST 2016


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

LGTM with nitpicks addressed.


================
Comment at: lib/Target/AArch64/AArch64RedundantCopyElimination.cpp:39
@@ +38,3 @@
+
+STATISTIC(NumCopyRemoved, "Number of copy removed.");
+
----------------
I'd call this NumCopiesRemoved.

================
Comment at: lib/Target/AArch64/AArch64RedundantCopyElimination.cpp:117-118
@@ +116,4 @@
+          // Clear any kills of TargetReg between CompBr and MI.
+          for (MachineBasicBlock::iterator I = MBB->begin(), E = MI; I != E;
+               ++I)
+            I->clearRegisterKills(DefReg, TRI);
----------------
Could be expressed as `for (MachineInstr &MMI : make_range(MBB->begin(), MI->getIterator()))`

================
Comment at: lib/Target/AArch64/AArch64RedundantCopyElimination.cpp:162
@@ +161,3 @@
+  bool Changed = false;
+  for (auto &I : MF)
+    Changed |= optimizeCopy(&I);
----------------
It's friendlier to people reading the sourcecode to write `MachineBasicBlock &MBB : MF`


http://reviews.llvm.org/D16203





More information about the llvm-commits mailing list