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

Unified Diff: src/compiler/simplified-operator-reducer.cc

Issue 1908093002: [turbofan] Optimize tagged conversion based on type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes Created 4 years, 8 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/simplified-operator.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator-reducer.cc
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc
index c3bac877e10c7846c9d37e0c838ca620ce3aab8b..8a7180e40ba12aeeb47de878b002611567ea789d 100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -50,6 +50,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
if (m.IsChangeTaggedToFloat64()) return Replace(m.node()->InputAt(0));
break;
}
+ case IrOpcode::kChangeInt31ToTagged:
case IrOpcode::kChangeInt32ToTagged: {
Int32Matcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceNumber(m.Value());
@@ -59,7 +60,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
NumberMatcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceFloat64(m.Value());
if (m.IsChangeFloat64ToTagged()) return Replace(m.node()->InputAt(0));
- if (m.IsChangeInt32ToTagged()) {
+ if (m.IsChangeInt31ToTagged() || m.IsChangeInt32ToTagged()) {
return Change(node, machine()->ChangeInt32ToFloat64(), m.InputAt(0));
}
if (m.IsChangeUint32ToTagged()) {
@@ -73,7 +74,9 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
if (m.IsChangeFloat64ToTagged()) {
return Change(node, machine()->ChangeFloat64ToInt32(), m.InputAt(0));
}
- if (m.IsChangeInt32ToTagged()) return Replace(m.InputAt(0));
+ if (m.IsChangeInt31ToTagged() || m.IsChangeInt32ToTagged()) {
+ return Replace(m.InputAt(0));
+ }
break;
}
case IrOpcode::kChangeTaggedToUint32: {
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698