Commit 6ccec5ce authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr][Turbofan] Adding missing representation changes corner cases

TaggedSigned to CompressedPointer, and TaggedPointer to CompressedSigned.

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: I9a257e583527256230576c7bc3d4c4b308570d2f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585729
Auto-Submit: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61046}
parent cf878af2
...@@ -592,7 +592,7 @@ Node* RepresentationChanger::GetCompressedSignedRepresentationFor( ...@@ -592,7 +592,7 @@ Node* RepresentationChanger::GetCompressedSignedRepresentationFor(
node); node);
} else if (output_rep == MachineRepresentation::kTaggedSigned) { } else if (output_rep == MachineRepresentation::kTaggedSigned) {
op = machine()->ChangeTaggedSignedToCompressedSigned(); op = machine()->ChangeTaggedSignedToCompressedSigned();
} else if (output_rep == MachineRepresentation::kTagged) { } else if (CanBeTaggedPointer(output_rep)) {
if (use_info.type_check() == TypeCheckKind::kSignedSmall) { if (use_info.type_check() == TypeCheckKind::kSignedSmall) {
op = simplified()->CheckedTaggedToCompressedSigned(use_info.feedback()); op = simplified()->CheckedTaggedToCompressedSigned(use_info.feedback());
} else if (output_type.Is(Type::SignedSmall())) { } else if (output_type.Is(Type::SignedSmall())) {
...@@ -642,7 +642,7 @@ Node* RepresentationChanger::GetCompressedPointerRepresentationFor( ...@@ -642,7 +642,7 @@ Node* RepresentationChanger::GetCompressedPointerRepresentationFor(
node); node);
} else if (output_rep == MachineRepresentation::kTaggedPointer) { } else if (output_rep == MachineRepresentation::kTaggedPointer) {
op = machine()->ChangeTaggedPointerToCompressedPointer(); op = machine()->ChangeTaggedPointerToCompressedPointer();
} else if (output_rep == MachineRepresentation::kTagged && } else if (CanBeTaggedSigned(output_rep) &&
use_info.type_check() == TypeCheckKind::kHeapObject) { use_info.type_check() == TypeCheckKind::kHeapObject) {
if (!output_type.Maybe(Type::SignedSmall())) { if (!output_type.Maybe(Type::SignedSmall())) {
return node; return node;
...@@ -650,8 +650,6 @@ Node* RepresentationChanger::GetCompressedPointerRepresentationFor( ...@@ -650,8 +650,6 @@ Node* RepresentationChanger::GetCompressedPointerRepresentationFor(
// TODO(turbofan): Consider adding a Bailout operator that just deopts // TODO(turbofan): Consider adding a Bailout operator that just deopts
// for TaggedSigned output representation. // for TaggedSigned output representation.
op = simplified()->CheckedTaggedToCompressedPointer(use_info.feedback()); op = simplified()->CheckedTaggedToCompressedPointer(use_info.feedback());
return TypeError(node, output_rep, output_type,
MachineRepresentation::kCompressedPointer);
} else if (output_rep == MachineRepresentation::kBit) { } else if (output_rep == MachineRepresentation::kBit) {
// TODO(v8:8977): specialize here and below // TODO(v8:8977): specialize here and below
node = GetTaggedPointerRepresentationFor(node, output_rep, output_type, node = GetTaggedPointerRepresentationFor(node, output_rep, output_type,
......
...@@ -663,6 +663,18 @@ TEST(CompressedAndTagged) { ...@@ -663,6 +663,18 @@ TEST(CompressedAndTagged) {
CheckChange(IrOpcode::kChangeTaggedToCompressedSigned, CheckChange(IrOpcode::kChangeTaggedToCompressedSigned,
MachineRepresentation::kTagged, Type::SignedSmall(), MachineRepresentation::kTagged, Type::SignedSmall(),
MachineRepresentation::kCompressedSigned); MachineRepresentation::kCompressedSigned);
// TaggedSigned to CompressedPointer
CheckChange(IrOpcode::kCheckedTaggedToCompressedPointer,
MachineRepresentation::kTaggedSigned, Type::SignedSmall(),
UseInfo(MachineRepresentation::kCompressedPointer,
Truncation::Any(), TypeCheckKind::kHeapObject));
// CompressedSigned to TaggedPointer
CheckChange(IrOpcode::kCheckedCompressedToTaggedPointer,
MachineRepresentation::kCompressedSigned, Type::SignedSmall(),
UseInfo(MachineRepresentation::kTaggedPointer, Truncation::Any(),
TypeCheckKind::kHeapObject));
} }
static void TestMinusZeroCheck(IrOpcode::Value expected, Type from_type) { static void TestMinusZeroCheck(IrOpcode::Value expected, Type from_type) {
......
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