Commit 31518ccc authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr] Avoid (de)compressions in CheckSmi

Avoids unnecessary compression and decompression nodes since we
are going to be able to check for smis without needing to decompress and
re-compress.

It was doing a CheckedInt32ToTaggedSigned ->
ChangeTaggedSignedToCompressedSigned combo, where we could just do
CheckedInt32ToCompressedSigned.

Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Bug: v8:7703
Change-Id: I0bbbbb5bd4744c49840c84b2fcb775fe6b603de0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1714878
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62917}
parent a6c859f9
......@@ -143,6 +143,33 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
}
break;
}
case IrOpcode::kChangeTaggedSignedToCompressedSigned: {
DCHECK(COMPRESS_POINTERS_BOOL);
NodeMatcher m(node->InputAt(0));
if (m.IsChangeInt31ToTaggedSigned()) {
Node* new_node = graph()->NewNode(
simplified()->ChangeInt31ToCompressedSigned(), m.InputAt(0));
return Replace(new_node);
} else if (m.IsCheckedInt32ToTaggedSigned()) {
// Create a new checked node that outputs CompressedSigned values, with
// an explicit decompression after it.
Node* new_checked = graph()->CloneNode(m.node());
NodeProperties::ChangeOp(
new_checked, simplified()->CheckedInt32ToCompressedSigned(
CheckParametersOf(m.node()->op()).feedback()));
Node* new_decompression = graph()->NewNode(
machine()->ChangeCompressedSignedToTaggedSigned(), new_checked);
// For all uses of the old checked node, instead insert the new "checked
// + decompression". Also, update control and effect.
ReplaceWithValue(m.node(), new_decompression, new_checked, new_checked);
// In the current node, we can skip the decompression since we are going
// to have a Decompression + Compression combo.
return Replace(new_checked);
}
break;
}
case IrOpcode::kCheckedTaggedToInt32:
case IrOpcode::kCheckedTaggedSignedToInt32: {
NodeMatcher m(node->InputAt(0));
......@@ -267,6 +294,10 @@ MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const {
return jsgraph()->machine();
}
SimplifiedOperatorBuilder* SimplifiedOperatorReducer::simplified() const {
return jsgraph()->simplified();
}
} // namespace compiler
} // namespace internal
} // namespace v8
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