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

Side by Side Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 1467193002: [turbofan] Simplify representations selection for phi. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // TODO(jochen): Remove this after the setting is turned on globally. 5 // TODO(jochen): Remove this after the setting is turned on globally.
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 MachineTypeUnion expected; 1987 MachineTypeUnion expected;
1988 }; 1988 };
1989 1989
1990 TestData test_data[] = { 1990 TestData test_data[] = {
1991 {Type::Signed32(), Type::Unsigned32(), kMachInt32, 1991 {Type::Signed32(), Type::Unsigned32(), kMachInt32,
1992 kRepWord32 | kTypeNumber}, 1992 kRepWord32 | kTypeNumber},
1993 {Type::Signed32(), Type::Unsigned32(), kMachUint32, 1993 {Type::Signed32(), Type::Unsigned32(), kMachUint32,
1994 kRepWord32 | kTypeNumber}, 1994 kRepWord32 | kTypeNumber},
1995 {Type::Signed32(), Type::Signed32(), kMachInt32, kMachInt32}, 1995 {Type::Signed32(), Type::Signed32(), kMachInt32, kMachInt32},
1996 {Type::Unsigned32(), Type::Unsigned32(), kMachInt32, kMachUint32}, 1996 {Type::Unsigned32(), Type::Unsigned32(), kMachInt32, kMachUint32},
1997 {Type::Number(), Type::Signed32(), kMachInt32, kMachFloat64}, 1997 {Type::Number(), Type::Signed32(), kMachInt32, kRepWord32 | kTypeNumber}};
1998 {Type::Signed32(), Type::String(), kMachInt32, kMachAnyTagged}};
1999 1998
2000 for (auto const d : test_data) { 1999 for (auto const d : test_data) {
2001 TestingGraph t(d.arg1, d.arg2, Type::Boolean()); 2000 TestingGraph t(d.arg1, d.arg2, Type::Boolean());
2002 2001
2003 Node* br = t.graph()->NewNode(t.common()->Branch(), t.p2, t.start); 2002 Node* br = t.graph()->NewNode(t.common()->Branch(), t.p2, t.start);
2004 Node* tb = t.graph()->NewNode(t.common()->IfTrue(), br); 2003 Node* tb = t.graph()->NewNode(t.common()->IfTrue(), br);
2005 Node* fb = t.graph()->NewNode(t.common()->IfFalse(), br); 2004 Node* fb = t.graph()->NewNode(t.common()->IfFalse(), br);
2006 Node* m = t.graph()->NewNode(t.common()->Merge(2), tb, fb); 2005 Node* m = t.graph()->NewNode(t.common()->Merge(2), tb, fb);
2007 2006
2008 Node* phi = 2007 Node* phi =
2009 t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), t.p0, t.p1, m); 2008 t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), t.p0, t.p1, m);
2010 2009
2011 Type* phi_type = Type::Union(d.arg1, d.arg2, z); 2010 Type* phi_type = Type::Union(d.arg1, d.arg2, z);
2012 NodeProperties::SetType(phi, phi_type); 2011 NodeProperties::SetType(phi, phi_type);
2013 2012
2014 Node* use = t.Use(phi, d.use); 2013 Node* use = t.Use(phi, d.use);
2015 t.Return(use); 2014 t.Return(use);
2016 t.Lower(); 2015 t.Lower();
2017 2016
2018 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); 2017 CHECK_EQ(d.expected, OpParameter<MachineType>(phi));
2019 } 2018 }
2020 } 2019 }
2021 2020
2022 } // namespace compiler 2021 } // namespace compiler
2023 } // namespace internal 2022 } // namespace internal
2024 } // namespace v8 2023 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698