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

Unified Diff: src/compiler/control-reducer.cc

Issue 1186973005: [turbofan] Remove another premature optimization from ControlReducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | test/unittests/compiler/control-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/control-reducer.cc
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc
index 633dfe5abf0b31eb76b13478d43e029edbb0740b..6e085ad7c23a6347d6a4e668391feaba079186d2 100644
--- a/src/compiler/control-reducer.cc
+++ b/src/compiler/control-reducer.cc
@@ -87,7 +87,7 @@ class ControlReducerImpl final : public AdvancedReducer {
}
// Try to statically fold a condition.
- Decision DecideCondition(Node* cond, bool recurse = true) {
+ Decision DecideCondition(Node* cond) {
switch (cond->opcode()) {
case IrOpcode::kInt32Constant:
return Int32Matcher(cond).Is(0) ? kFalse : kTrue;
@@ -98,19 +98,6 @@ class ControlReducerImpl final : public AdvancedReducer {
HeapObjectMatcher<Object>(cond).Value().handle();
return object->BooleanValue() ? kTrue : kFalse;
}
- case IrOpcode::kPhi: {
- if (!recurse) return kUnknown; // Only go one level deep checking phis.
- Decision result = kUnknown;
- // Check if all inputs to a phi result in the same decision.
- for (int i = cond->op()->ValueInputCount() - 1; i >= 0; i--) {
- // Recurse only one level, since phis can be involved in cycles.
- Decision decision = DecideCondition(cond->InputAt(i), false);
- if (decision == kUnknown) return kUnknown;
- if (result == kUnknown) result = decision;
- if (result != decision) return kUnknown;
- }
- return result;
- }
default:
break;
}
« no previous file with comments | « no previous file | test/unittests/compiler/control-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698