Commit 6eee152b authored by Michael Achenbach's avatar Michael Achenbach Committed by V8 LUCI CQ

Revert "[compiler] Slightly generalize type assertions"

This reverts commit ccbfa918.

Reason for revert: Speculative revert for:
https://ci.chromium.org/p/v8/builders/ci/V8%20NumFuzz%20-%20debug/14050

Original change's description:
> [compiler] Slightly generalize type assertions
>
> ... to also apply to common integer bitset types.
>
> Bug: v8:11724
> Change-Id: I41077488688e924e4235911d3a90e15044c229bd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2865747
> Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Auto-Submit: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74330}

Bug: v8:11724
Change-Id: I52268d5d553ba271e0a383b6af89b971892a67da
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2868605
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#74337}
parent 3a2575c2
......@@ -27,7 +27,9 @@ Reduction AddTypeAssertionsReducer::Reduce(Node* node) {
visited_.Set(node, true);
Type type = NodeProperties::GetType(node);
if (!type.CanBeAsserted()) return NoChange();
if (!type.IsRange()) {
return NoChange();
}
Node* assertion = graph()->NewNode(simplified()->AssertType(type), node);
NodeProperties::SetType(assertion, type);
......
......@@ -5867,10 +5867,11 @@ Node* EffectControlLinearizer::CallBuiltin(Builtins::Name builtin,
Node* EffectControlLinearizer::LowerAssertType(Node* node) {
DCHECK_EQ(node->opcode(), IrOpcode::kAssertType);
Type type = OpParameter<Type>(node->op());
CHECK(type.CanBeAsserted());
DCHECK(type.IsRange());
auto range = type.AsRange();
Node* const input = node->InputAt(0);
Node* const min = __ NumberConstant(type.Min());
Node* const max = __ NumberConstant(type.Max());
Node* const min = __ NumberConstant(range->Min());
Node* const max = __ NumberConstant(range->Max());
CallBuiltin(Builtins::kCheckNumberInRange, node->op()->properties(), input,
min, max, __ SmiConstant(node->id()));
return input;
......
......@@ -413,10 +413,6 @@ class V8_EXPORT_PRIVATE Type {
(Is(Type::PlainNumber()) && Min() == Max());
}
bool CanBeAsserted() const {
return IsRange() || (Is(Type::Integral32()) && !IsNone());
}
const HeapConstantType* AsHeapConstant() const;
const OtherNumberConstantType* AsOtherNumberConstant() const;
const RangeType* AsRange() const;
......
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