[turbofan] Do not map nodes to the same path state
In {ControlPathState} with {kMultipleInstances}, a node should be able to be mapped to different states, but not twice to an identical state. Change-Id: Ida340a6f4f5e891f586d5a90e7ae818f24dfbe98 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3769693 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org> Cr-Commit-Position: refs/heads/main@{#81775}
This commit is contained in:
parent
090156f8ad
commit
5e269d565d
@ -135,7 +135,11 @@ template <typename NodeState, NodeUniqueness node_uniqueness>
|
||||
void ControlPathState<NodeState, node_uniqueness>::AddState(
|
||||
Zone* zone, Node* node, NodeState state,
|
||||
ControlPathState<NodeState, node_uniqueness> hint) {
|
||||
if (node_uniqueness == kUniqueInstance && LookupState(node).IsSet()) return;
|
||||
NodeState previous_state = LookupState(node);
|
||||
if (node_uniqueness == kUniqueInstance ? previous_state.IsSet()
|
||||
: previous_state == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
FunctionalList<NodeState> prev_front = blocks_.Front();
|
||||
if (hint.blocks_.Size() > 0) {
|
||||
@ -153,7 +157,9 @@ template <typename NodeState, NodeUniqueness node_uniqueness>
|
||||
void ControlPathState<NodeState, node_uniqueness>::AddStateInNewBlock(
|
||||
Zone* zone, Node* node, NodeState state) {
|
||||
FunctionalList<NodeState> new_block;
|
||||
if (node_uniqueness == kMultipleInstances || !LookupState(node).IsSet()) {
|
||||
NodeState previous_state = LookupState(node);
|
||||
if (node_uniqueness == kUniqueInstance ? !previous_state.IsSet()
|
||||
: previous_state != state) {
|
||||
new_block.PushFront(state, zone);
|
||||
states_.Set({node, depth(blocks_.Size() + 1)}, state);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user