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

[ptr-compr][CSA] Enable the DecompressionOptimizer phase in CSA

Also update the MachineGraphVerifier to take into account the
possibility of the Store receiving a Compressed representation as well.

Bug: v8:7703
Change-Id: I6d6e28b980151af6296000cfe6f67a3a037b029c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1859627
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64410}
parent 014c977f
...@@ -617,7 +617,15 @@ class MachineRepresentationChecker { ...@@ -617,7 +617,15 @@ class MachineRepresentationChecker {
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
case MachineRepresentation::kTaggedPointer: case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTaggedSigned: case MachineRepresentation::kTaggedSigned:
CheckValueInputIsTagged(node, 2); if (COMPRESS_POINTERS_BOOL &&
!FLAG_turbo_decompression_elimination &&
node->opcode() == IrOpcode::kStore &&
CanBeTaggedPointer(
StoreRepresentationOf(node->op()).representation())) {
CheckValueInputIsCompressedOrTagged(node, 2);
} else {
CheckValueInputIsTagged(node, 2);
}
break; break;
case MachineRepresentation::kCompressed: case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedPointer: case MachineRepresentation::kCompressedPointer:
...@@ -799,6 +807,27 @@ class MachineRepresentationChecker { ...@@ -799,6 +807,27 @@ class MachineRepresentationChecker {
FATAL("%s", str.str().c_str()); FATAL("%s", str.str().c_str());
} }
void CheckValueInputIsCompressedOrTagged(Node const* node, int index) {
Node const* input = node->InputAt(index);
switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kTagged:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTaggedSigned:
return;
default:
break;
}
std::ostringstream str;
str << "TypeError: node #" << node->id() << ":" << *node->op()
<< " uses node #" << input->id() << ":" << *input->op()
<< " which doesn't have a compressed or tagged representation.";
PrintDebugHelp(str, node);
FATAL("%s", str.str().c_str());
}
void CheckValueInputIsTaggedOrPointer(Node const* node, int index) { void CheckValueInputIsTaggedOrPointer(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
switch (inferrer_->GetRepresentation(input)) { switch (inferrer_->GetRepresentation(input)) {
......
...@@ -2571,6 +2571,10 @@ MaybeHandle<Code> Pipeline::GenerateCodeForCodeStub( ...@@ -2571,6 +2571,10 @@ MaybeHandle<Code> Pipeline::GenerateCodeForCodeStub(
pipeline.Run<CsaOptimizationPhase>(); pipeline.Run<CsaOptimizationPhase>();
pipeline.RunPrintAndVerify(CsaOptimizationPhase::phase_name(), true); pipeline.RunPrintAndVerify(CsaOptimizationPhase::phase_name(), true);
pipeline.Run<DecompressionOptimizationPhase>();
pipeline.RunPrintAndVerify(DecompressionOptimizationPhase::phase_name(),
true);
pipeline.Run<VerifyGraphPhase>(true); pipeline.Run<VerifyGraphPhase>(true);
pipeline.ComputeScheduledGraph(); pipeline.ComputeScheduledGraph();
DCHECK_NOT_NULL(data.schedule()); DCHECK_NOT_NULL(data.schedule());
......
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