Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 1333353005: [turbofan] Limit the load/store machine types to the ones we actually use. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-simplified-lowering.cc
diff --git a/test/cctest/compiler/test-simplified-lowering.cc b/test/cctest/compiler/test-simplified-lowering.cc
index 269927c480f231885c7563378b5805c5a8627011..a110e63958eb2b73798824383fa7f726de7721e1 100644
--- a/test/cctest/compiler/test-simplified-lowering.cc
+++ b/test/cctest/compiler/test-simplified-lowering.cc
@@ -745,17 +745,6 @@ class TestingGraph : public HandleAndZoneScope, public GraphAndBuilders {
}
}
- Node* ExampleWithTypeAndRep(Type* type, MachineType mach_type) {
- FieldAccess access = {kUntaggedBase, 0, Handle<Name>::null(), type,
- mach_type};
- // TODO(titzer): using loads here just to force the representation is ugly.
- Node* node = graph()->NewNode(simplified()->LoadField(access),
- jsgraph.IntPtrConstant(0), graph()->start(),
- graph()->start());
- NodeProperties::SetBounds(node, Bounds(type));
- return node;
- }
-
Node* Use(Node* node, MachineType type) {
if (type & kTypeInt32) {
return graph()->NewNode(machine()->Int32LessThan(), node,
@@ -1069,7 +1058,7 @@ TEST(LowerNumberToInt32_to_ChangeTaggedToInt32) {
TEST(LowerNumberToInt32_to_TruncateFloat64ToInt32) {
// NumberToInt32(x: kRepFloat64) used as kMachInt32
TestingGraph t(Type::Number());
- Node* p0 = t.ExampleWithTypeAndRep(Type::Number(), kMachFloat64);
+ Node* p0 = t.ExampleWithOutput(kMachFloat64);
Node* trunc = t.graph()->NewNode(t.simplified()->NumberToInt32(), p0);
Node* use = t.Use(trunc, kMachInt32);
t.Return(use);
@@ -1158,7 +1147,7 @@ TEST(LowerNumberToUint32_to_TruncateFloat64ToInt32_with_change) {
TEST(LowerNumberToUint32_to_TruncateFloat64ToInt32_uint32) {
// NumberToUint32(x: kRepFloat64) used as kRepWord32
TestingGraph t(Type::Unsigned32());
- Node* input = t.ExampleWithTypeAndRep(Type::Number(), kMachFloat64);
+ Node* input = t.ExampleWithOutput(kMachFloat64);
Node* trunc = t.graph()->NewNode(t.simplified()->NumberToUint32(), input);
Node* use = t.Use(trunc, kRepWord32);
t.Return(use);
@@ -1167,58 +1156,6 @@ TEST(LowerNumberToUint32_to_TruncateFloat64ToInt32_uint32) {
}
-TEST(LowerNumberToUI32_of_Float64_used_as_word32) {
- // NumberTo(Int,Uint)32(x: kRepFloat64 | kType(Int,Uint)32) used as
- // kType(Int,Uint)32 | kRepWord32
- Type* types[] = {Type::Signed32(), Type::Unsigned32()};
- MachineType mach[] = {kTypeInt32, kTypeUint32, kMachNone};
-
- for (int i = 0; i < 2; i++) {
- for (int u = 0; u < 3; u++) {
- TestingGraph t(types[i]);
- Node* input = t.ExampleWithTypeAndRep(
- types[i], static_cast<MachineType>(kRepFloat64 | mach[i]));
- const Operator* op = i == 0 ? t.simplified()->NumberToInt32()
- : t.simplified()->NumberToUint32();
- Node* trunc = t.graph()->NewNode(op, input);
- Node* use = t.Use(trunc, static_cast<MachineType>(kRepWord32 | mach[u]));
- t.Return(use);
- t.Lower();
- IrOpcode::Value opcode = i == 0 ? IrOpcode::kChangeFloat64ToInt32
- : IrOpcode::kChangeFloat64ToUint32;
- CheckChangeOf(opcode, input, use->InputAt(0));
- }
- }
-}
-
-
-TEST(LowerNumberToUI32_of_Float64_used_as_tagged) {
- // NumberTo(Int,Uint)32(x: kRepFloat64 | kType(Int,Uint)32) used as
- // kType(Int,Uint)32 | kRepTagged
- Type* types[] = {Type::Signed32(), Type::Unsigned32(), Type::Any()};
- MachineType mach[] = {kTypeInt32, kTypeUint32, kMachNone};
-
- for (int i = 0; i < 2; i++) {
- for (int u = 0; u < 3; u++) {
- TestingGraph t(types[i]);
- Node* input = t.ExampleWithTypeAndRep(
- types[i], static_cast<MachineType>(kRepFloat64 | mach[i]));
- const Operator* op = i == 0 ? t.simplified()->NumberToInt32()
- : t.simplified()->NumberToUint32();
- Node* trunc = t.graph()->NewNode(op, input);
- // TODO(titzer): we use the store here to force the representation.
- FieldAccess access = {kTaggedBase, 0, Handle<Name>(), types[u],
- static_cast<MachineType>(mach[u] | kRepTagged)};
- Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0,
- trunc, t.start, t.start);
- t.Effect(store);
- t.Lower();
- CheckChangeOf(IrOpcode::kChangeFloat64ToTagged, input, store->InputAt(2));
- }
- }
-}
-
-
TEST(LowerReferenceEqual_to_wordeq) {
TestingGraph t(Type::Any(), Type::Any());
IrOpcode::Value opcode =
@@ -1397,8 +1334,8 @@ Node* CheckElementAccessArithmetic(ElementAccess access, Node* load_or_store) {
}
-const MachineType kMachineReps[] = {kRepBit, kMachInt8, kMachInt16,
- kMachInt32, kMachInt64, kMachFloat64,
+const MachineType kMachineReps[] = {kMachInt8, kMachInt16, kMachInt32,
+ kMachUint32, kMachInt64, kMachFloat64,
kMachAnyTagged};
} // namespace
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698