Commit bee54367 authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

[regalloc] Fix for verifier overwritting final assessments.

This fixes a subtle register allocation verifier bug: depending on how moves are 
optimized, and when having duplicate phis, we may end up overwriting a final
assessment.

Bug: 
Change-Id: I8b7891efbdd075aae0219d60270f405b13d50f40
Reviewed-on: https://chromium-review.googlesource.com/577288Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46941}
parent c80ff604
......@@ -455,9 +455,14 @@ void RegisterAllocatorVerifier::ValidatePendingAssessment(
}
}
}
// If everything checks out, we may make the assessment.
current_assessments->map()[op] =
new (zone()) FinalAssessment(virtual_register, assessment);
// If everything checks out, we may make the assessment, unless the operand
// was redefined in this block: it was initially used for the phi, but then
// also used as an output operand.
if (current_assessments->map()[op] == nullptr ||
current_assessments->map()[op]->kind() == Pending) {
current_assessments->map()[op] =
new (zone()) FinalAssessment(virtual_register, assessment);
}
}
void RegisterAllocatorVerifier::ValidateFinalAssessment(
......
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