[PATCH] D22027: BranchFolding: Use LivePhysReg to update live in lists.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 06:56:58 PDT 2016


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

LGTM


================
Comment at: lib/CodeGen/BranchFolding.cpp:25
@@ -24,2 +24,3 @@
 #include "llvm/CodeGen/Analysis.h"
+#include "llvm/CodeGen/LivePhysRegs.h"
 #include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
----------------
Since it's in the .h already, remove it from here?

================
Comment at: lib/CodeGen/BranchFolding.cpp:415
@@ +414,3 @@
+    bool ContainsSuperReg = false;
+    for (MCSuperRegIterator SReg(Reg, TRI, false); SReg.isValid(); ++SReg) {
+      if (LiveRegs.contains(*SReg)) {
----------------
false -> /*IncludeSelf=*/ false,  or even remove it?

================
Comment at: lib/CodeGen/BranchFolding.cpp:433
@@ -428,2 +432,3 @@
 
   // For targets that use the register scavenger, we must maintain LiveIns.
+  computeLiveIns(*NewDest);
----------------
stale comment (here and later)

================
Comment at: lib/CodeGen/BranchFolding.h:106
@@ -104,3 +105,3 @@
     MachineLoopInfo *MLI;
-    RegScavenger *RS;
+    LivePhysRegs LiveRegs;
 
----------------
Sounds good; I thought init() re-did the allocation, but that's not true.


Repository:
  rL LLVM

http://reviews.llvm.org/D22027





More information about the llvm-commits mailing list