[PATCH] D12813: RegisterPressure: Simplify close{Top|Bottom}()

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 11:25:50 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL247588: RegisterPressure: Simplify close{Top|Bottom}() (authored by matze).

Changed prior to commit:
  http://reviews.llvm.org/D12813?vs=34580&id=34712#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12813

Files:
  llvm/trunk/lib/CodeGen/RegisterPressure.cpp

Index: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp
@@ -252,12 +252,7 @@
   assert(P.LiveInRegs.empty() && "inconsistent max pressure result");
   P.LiveInRegs.reserve(LiveRegs.PhysRegs.size() + LiveRegs.VirtRegs.size());
   P.LiveInRegs.append(LiveRegs.PhysRegs.begin(), LiveRegs.PhysRegs.end());
-  for (SparseSet<unsigned>::const_iterator I =
-         LiveRegs.VirtRegs.begin(), E = LiveRegs.VirtRegs.end(); I != E; ++I)
-    P.LiveInRegs.push_back(*I);
-  std::sort(P.LiveInRegs.begin(), P.LiveInRegs.end());
-  P.LiveInRegs.erase(std::unique(P.LiveInRegs.begin(), P.LiveInRegs.end()),
-                     P.LiveInRegs.end());
+  P.LiveInRegs.append(LiveRegs.VirtRegs.begin(), LiveRegs.VirtRegs.end());
 }
 
 /// Set the boundary for the bottom of the region and summarize live outs.
@@ -270,12 +265,7 @@
   assert(P.LiveOutRegs.empty() && "inconsistent max pressure result");
   P.LiveOutRegs.reserve(LiveRegs.PhysRegs.size() + LiveRegs.VirtRegs.size());
   P.LiveOutRegs.append(LiveRegs.PhysRegs.begin(), LiveRegs.PhysRegs.end());
-  for (SparseSet<unsigned>::const_iterator I =
-         LiveRegs.VirtRegs.begin(), E = LiveRegs.VirtRegs.end(); I != E; ++I)
-    P.LiveOutRegs.push_back(*I);
-  std::sort(P.LiveOutRegs.begin(), P.LiveOutRegs.end());
-  P.LiveOutRegs.erase(std::unique(P.LiveOutRegs.begin(), P.LiveOutRegs.end()),
-                      P.LiveOutRegs.end());
+  P.LiveOutRegs.append(LiveRegs.VirtRegs.begin(), LiveRegs.VirtRegs.end());
 }
 
 /// Finalize the region boundaries and record live ins and live outs.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12813.34712.patch
Type: text/x-patch
Size: 1700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150914/699597c0/attachment.bin>


More information about the llvm-commits mailing list