Commit 66c6cadc authored by mtrofin's avatar mtrofin Committed by Commit bot

[turbofan] Validation for deferred->hot transition edges

Validate that the transition from deferred to hot happens through a
deferred block with one successor. This is needed for frame elision: if
we need to deconstruct the frame on the deferred path, this extra block
offers that location.

A precondition for this validation is that the sequence is in split edge
form.

BUG=

Review URL: https://codereview.chromium.org/1811213003

Cr-Commit-Position: refs/heads/master@{#35015}
parent a8274000
......@@ -635,6 +635,17 @@ void InstructionSequence::ValidateEdgeSplitForm() {
}
}
void InstructionSequence::ValidateDeferredBlockExitPaths() {
// A deferred block with more than one successor must have all its successors
// deferred.
for (const InstructionBlock* block : instruction_blocks()) {
if (!block->IsDeferred() || block->SuccessorCount() <= 1) continue;
for (RpoNumber successor_id : block->successors()) {
CHECK(InstructionBlockAt(successor_id)->IsDeferred());
}
}
}
void InstructionSequence::ValidateSSA() {
// TODO(mtrofin): We could use a local zone here instead.
BitVector definitions(VirtualRegisterCount(), zone());
......
......@@ -1355,6 +1355,7 @@ class InstructionSequence final : public ZoneObject {
void PrintBlock(int block_id) const;
void ValidateEdgeSplitForm();
void ValidateDeferredBlockExitPaths();
void ValidateSSA();
private:
......
......@@ -1446,6 +1446,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
#ifdef DEBUG
debug_name = info()->GetDebugName();
data_->sequence()->ValidateEdgeSplitForm();
data_->sequence()->ValidateDeferredBlockExitPaths();
#endif
data->InitializeRegisterAllocationData(config, descriptor, debug_name.get());
......
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