Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: src/IceRegAlloc.cpp

Issue 848603002: Subzero: Use SmallVector<> instead of vector<> in a couple places. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.cpp
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp
index e7ba50ffbf73127c2de29b2a8d6bcfeb3546f8d3..4ba82a06032fe65dc349c7dda1a1c37deaeb2fab 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -24,6 +24,10 @@ namespace Ice {
namespace {
+// TODO(stichnot): Statically choose the size based on the target
+// being compiled.
+const size_t REGS_SIZE = 32;
+
// Returns true if Var has any definitions within Item's live range.
// TODO(stichnot): Consider trimming the Definitions list similar to
// how the live ranges are trimmed, since all the overlapsDefs() tests
@@ -280,7 +284,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull,
// RegUses[I] is the number of live ranges (variables) that register
// I is currently assigned to. It can be greater than 1 as a result
// of AllowOverlap inference below.
- std::vector<int> RegUses(NumRegisters);
+ llvm::SmallVector<int, REGS_SIZE> RegUses(NumRegisters);
// Unhandled is already set to all ranges in increasing order of
// start points.
assert(Active.empty());
@@ -484,7 +488,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull,
}
}
- std::vector<RegWeight> Weights(RegMask.size());
+ llvm::SmallVector<RegWeight, REGS_SIZE> Weights(RegMask.size());
// Remove registers from the Free[] list where an Unhandled
// precolored range overlaps with the current range, and set those
@@ -666,9 +670,6 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull,
Inactive.clear();
dump(Func);
- // TODO(stichnot): Statically choose the size based on the target
- // being compiled.
- const size_t REGS_SIZE = 32;
llvm::SmallVector<int32_t, REGS_SIZE> Permutation(NumRegisters);
if (Randomized) {
Func->getTarget()->makeRandomRegisterPermutation(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698