Commit fa621404 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

Reland "[turbofan][ptr-compr] Remove redundant ChangeTaggedToCompressed"

This is a reland of c924f54e

Will split the CL into parts since debugging is really hard for the
combination of tests + bots that caused the failure.

Relanding the safest part on this first CL.

The difference between the original commit and this one can be seen in
patchsets 1..2.

Original change's description:
> [turbofan][ptr-compr] Remove redundant ChangeTaggedToCompressed
>
> The final goal is to eliminate it altogether. This CL just
> eliminate the redundant ones.
>
> Bug: v8:7703
> Change-Id: If6e718c373fca7c65ce46c347533ec4550fbc444
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1950968
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65398}

Bug: v8:7703
Change-Id: I5ff513a53eebcee6e2412f7ea8b801789476d50f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1962277Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65423}
parent 3f2fb425
......@@ -4988,16 +4988,6 @@ Node* EffectControlLinearizer::BuildTypedArrayDataPointer(Node* base,
return external;
} else {
if (COMPRESS_POINTERS_BOOL) {
// TurboFan does not support loading of compressed fields without
// decompression so we add the following operations to workaround that.
// We can't load the base value as word32 because in that case the
// value will not be marked as tagged in the pointer map and will not
// survive GC.
// Compress base value back to in order to be able to decompress by
// doing an unsafe add below. Both decompression and compression
// will be removed by the decompression elimination pass.
base = __ ChangeTaggedToCompressed(base);
base = __ BitcastTaggedToWord(base);
// Zero-extend Tagged_t to UintPtr according to current compression
// scheme so that the addition with |external_pointer| (which already
// contains compensated offset value) will decompress the tagged value.
......
......@@ -240,22 +240,6 @@ void MemoryOptimizer::VisitNode(Node* node, AllocationState const* state) {
bool MemoryOptimizer::AllocationTypeNeedsUpdateToOld(Node* const node,
const Edge edge) {
if (COMPRESS_POINTERS_BOOL &&
node->opcode() == IrOpcode::kChangeTaggedToCompressed) {
// In Pointer Compression we might have a Compress node between an
// AllocateRaw and the value used as input. This case is trickier since we
// have to check all of the Compress node edges to test for a StoreField.
for (Edge const new_edge : node->use_edges()) {
if (AllocationTypeNeedsUpdateToOld(new_edge.from(), new_edge)) {
return true;
}
}
// If we arrived here, we tested all the edges of the Compress node and
// didn't find it necessary to update the AllocationType.
return false;
}
// Test to see if we need to update the AllocationType.
if (node->opcode() == IrOpcode::kStoreField && edge.index() == 1) {
Node* parent = node->InputAt(0);
......@@ -283,14 +267,6 @@ void MemoryOptimizer::VisitAllocateRaw(Node* node,
Node* const user = edge.from();
if (user->opcode() == IrOpcode::kStoreField && edge.index() == 0) {
Node* child = user->InputAt(1);
// In Pointer Compression we might have a Compress node between an
// AllocateRaw and the value used as input. If so, we need to update
// child to point to the StoreField.
if (COMPRESS_POINTERS_BOOL &&
child->opcode() == IrOpcode::kChangeTaggedToCompressed) {
child = child->InputAt(0);
}
if (child->opcode() == IrOpcode::kAllocateRaw &&
AllocationTypeOf(child->op()) == AllocationType::kYoung) {
NodeProperties::ChangeOp(child, node->op());
......
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