Commit 5bc35c1c authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[turbofan] Update redundancy elimination for feedback

Update notion of compatibility used in redundancy elimination
to determine whether one check subsumes another check to ignore
the feedback on the operator.

Bug: v8:7127
Change-Id: I77ab8a64adcd2b36ee7eafbe6cc148ddbc430b11
Reviewed-on: https://chromium-review.googlesource.com/839441
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50318}
parent 8c68b655
......@@ -5,6 +5,7 @@
#include "src/compiler/redundancy-elimination.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
namespace v8 {
namespace internal {
......@@ -129,14 +130,36 @@ bool IsCompatibleCheck(Node const* a, Node const* b) {
if (a->opcode() == IrOpcode::kCheckInternalizedString &&
b->opcode() == IrOpcode::kCheckString) {
// CheckInternalizedString(node) implies CheckString(node)
} else if (a->opcode() == IrOpcode::kCheckBounds &&
b->opcode() == IrOpcode::kCheckBounds) {
// CheckBounds are compatible independent of associated feedback.
} else if (a->opcode() == IrOpcode::kCheckNumber &&
b->opcode() == IrOpcode::kCheckNumber) {
// CheckNumbers are compatible independent of associated feedback.
} else {
} else if (a->opcode() != b->opcode()) {
return false;
} else {
switch (a->opcode()) {
case IrOpcode::kCheckBounds:
case IrOpcode::kCheckSmi:
case IrOpcode::kCheckString:
case IrOpcode::kCheckNumber:
break;
case IrOpcode::kCheckedTaggedSignedToInt32:
case IrOpcode::kCheckedTaggedToTaggedSigned:
case IrOpcode::kCheckedUint32ToInt32:
case IrOpcode::kCheckedUint32ToTaggedSigned:
case IrOpcode::kCheckedInt32ToTaggedSigned:
case IrOpcode::kCheckedTaggedToTaggedPointer:
break;
case IrOpcode::kCheckedFloat64ToInt32:
case IrOpcode::kCheckedTaggedToInt32: {
const CheckMinusZeroParameters& ap =
CheckMinusZeroParametersOf(a->op());
const CheckMinusZeroParameters& bp =
CheckMinusZeroParametersOf(b->op());
if (ap.mode() != bp.mode()) {
return false;
}
break;
}
default:
return false;
}
}
}
for (int i = a->op()->ValueInputCount(); --i >= 0;) {
......
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