Commit c83aff3b authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[regalloc] Fix non-deterministic iteration in register allocator

Change-Id: I5c391f606994ba1fc3dfb53483a0cc0f1caa25e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1521107Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60265}
parent c853d114
......@@ -3314,7 +3314,14 @@ void LinearScanAllocator::ComputeStateFromManyPredecessors(
size_t count;
int used_registers[RegisterConfiguration::kMaxRegisters];
};
ZoneMap<TopLevelLiveRange*, Vote> counts(data()->allocation_zone());
struct TopLevelLiveRangeComparator {
bool operator()(const TopLevelLiveRange* lhs,
const TopLevelLiveRange* rhs) const {
return lhs->vreg() < rhs->vreg();
}
};
ZoneMap<TopLevelLiveRange*, Vote, TopLevelLiveRangeComparator> counts(
data()->allocation_zone());
int deferred_blocks = 0;
for (RpoNumber pred : current_block->predecessors()) {
if (!ConsiderBlockForControlFlow(current_block, pred)) {
......
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