Commit 108cd50b authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[gasm] Fix superfluous LoopExitValue node

Loop exits are marked automatically by the loop scope mechanism in
combination with MergeState. Creating a LoopExitValue node explicitly
created an invalid graph.

Drive-by: Remove LoopExit{,Effect,Value} convenience methods.

Bug: chromium:1044878,v8:9972
Change-Id: I6fb52a8463e5352b5a5b243f800a9eda47df9d5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2016593
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65949}
parent aab3f045
......@@ -632,20 +632,6 @@ Node* GraphAssembler::Checkpoint(FrameState frame_state) {
control()));
}
Node* GraphAssembler::LoopExit(Control loop_header) {
return AddNode(
graph()->NewNode(common()->LoopExit(), control(), loop_header));
}
Node* GraphAssembler::LoopExitEffect() {
return AddNode(
graph()->NewNode(common()->LoopExitEffect(), effect(), control()));
}
Node* GraphAssembler::LoopExitValue(Node* value) {
return AddNode(graph()->NewNode(common()->LoopExitValue(), value, control()));
}
Node* GraphAssembler::DebugBreak() {
return AddNode(
graph()->NewNode(machine()->DebugBreak(), effect(), control()));
......
......@@ -307,9 +307,6 @@ class V8_EXPORT_PRIVATE GraphAssembler {
Node* TypeGuard(Type type, Node* value);
Node* Checkpoint(FrameState frame_state);
Node* LoopExit(Control loop_header);
Node* LoopExitEffect();
Node* LoopExitValue(Node* value);
Node* Store(StoreRepresentation rep, Node* object, Node* offset, Node* value);
Node* Load(MachineType type, Node* object, Node* offset);
......@@ -547,10 +544,12 @@ void GraphAssembler::MergeState(GraphAssemblerLabel<sizeof...(Vars)>* label,
DCHECK_NOT_NULL(*loop_headers_.back());
// Mark this exit to enable loop peeling.
LoopExit(Control{*loop_headers_.back()});
LoopExitEffect();
AddNode(graph()->NewNode(common()->LoopExit(), control(),
*loop_headers_.back()));
AddNode(graph()->NewNode(common()->LoopExitEffect(), effect(), control()));
for (size_t i = 0; i < kVarCount; i++) {
var_array[i] = LoopExitValue(var_array[i]);
var_array[i] = AddNode(
graph()->NewNode(common()->LoopExitValue(), var_array[i], control()));
}
}
......
......@@ -544,8 +544,7 @@ class JSCallReducerAssembler : public JSGraphAssembler {
}
gasm_->Bind(&loop_exit);
return TNode<Object>::UncheckedCast(
gasm_->LoopExitValue(loop_exit.PhiAt<Object>(0)));
return TNode<Object>::UncheckedCast(loop_exit.PhiAt<Object>(0));
}
void ValueIsUnused() { USE(Value()); }
......
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