Commit e34d79de by Jim Stichnoth

Subzero: Use SmallVector<> instead of vector<> in a couple places.

BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/848603002
parent 3018545a
...@@ -24,6 +24,10 @@ namespace Ice { ...@@ -24,6 +24,10 @@ namespace Ice {
namespace { 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. // Returns true if Var has any definitions within Item's live range.
// TODO(stichnot): Consider trimming the Definitions list similar to // TODO(stichnot): Consider trimming the Definitions list similar to
// how the live ranges are trimmed, since all the overlapsDefs() tests // how the live ranges are trimmed, since all the overlapsDefs() tests
...@@ -280,7 +284,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull, ...@@ -280,7 +284,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull,
// RegUses[I] is the number of live ranges (variables) that register // 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 // I is currently assigned to. It can be greater than 1 as a result
// of AllowOverlap inference below. // 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 // Unhandled is already set to all ranges in increasing order of
// start points. // start points.
assert(Active.empty()); assert(Active.empty());
...@@ -484,7 +488,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull, ...@@ -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 // Remove registers from the Free[] list where an Unhandled
// precolored range overlaps with the current range, and set those // precolored range overlaps with the current range, and set those
...@@ -666,9 +670,6 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull, ...@@ -666,9 +670,6 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull,
Inactive.clear(); Inactive.clear();
dump(Func); 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); llvm::SmallVector<int32_t, REGS_SIZE> Permutation(NumRegisters);
if (Randomized) { if (Randomized) {
Func->getTarget()->makeRandomRegisterPermutation( Func->getTarget()->makeRandomRegisterPermutation(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment