[PATCH] D17474: MachineCopyPropagation: Keep scanning through instructions with regmasks

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 17:44:38 PST 2016


qcolombet accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/CodeGen/MachineCopyPropagation.cpp:93
@@ -98,1 +92,3 @@
+    CopyMap.erase(*AI);
+    AvailCopyMap.erase(*AI);
   }
----------------
Any reason why the two loops are not merged?

================
Comment at: lib/CodeGen/MachineCopyPropagation.cpp:129
@@ +128,3 @@
+    if (RegMask.clobbersPhysReg(Reg))
+      Map.erase(I);
+  }
----------------
I was wondering if it would be more efficient to traverse the clobbered registers and erase the entries in the map accordingly, but I figured the map is usually pretty small.
Maybe add a comment on that so that we don't have to think about it when we come across the code again.

================
Comment at: test/CodeGen/X86/machine-copy-prop.mir:1
@@ -1,2 +1,2 @@
-# RUN: llc -march=x86 -run-pass machine-cp -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck %s
+# RUN: llc -march=x86 -run-pass machine-cp -o /dev/null %s 2>&1 | FileCheck %s
 
----------------
-verify-machineinstrs?

================
Comment at: test/CodeGen/X86/machine-copy-prop.mir:13
@@ -9,3 +12,3 @@
 ---
 # The second copy is redundand and will be removed, check that we also remove
 # the kill flag of intermediate instructions.
----------------
typo -> redundant


Repository:
  rL LLVM

http://reviews.llvm.org/D17474





More information about the llvm-commits mailing list