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

Unified Diff: src/compiler/phi-reducer.h

Issue 684993006: Remove PhiReducer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « BUILD.gn ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/phi-reducer.h
diff --git a/src/compiler/phi-reducer.h b/src/compiler/phi-reducer.h
deleted file mode 100644
index 787db1cb1d097adb427e730b3846e9553d5c6ff2..0000000000000000000000000000000000000000
--- a/src/compiler/phi-reducer.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_PHI_REDUCER_H_
-#define V8_COMPILER_PHI_REDUCER_H_
-
-#include "src/compiler/generic-node-inl.h"
-#include "src/compiler/graph-reducer.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// Replaces redundant phis if all the inputs are the same or the phi itself.
-class PhiReducer FINAL : public Reducer {
- public:
- virtual Reduction Reduce(Node* node) OVERRIDE {
- if (node->opcode() != IrOpcode::kPhi &&
- node->opcode() != IrOpcode::kEffectPhi)
- return NoChange();
-
- int n = node->op()->InputCount();
- if (n == 1) return Replace(node->InputAt(0));
-
- Node* replacement = NULL;
- Node::Inputs inputs = node->inputs();
- for (InputIter it = inputs.begin(); n > 0; --n, ++it) {
- Node* input = *it;
- if (input != node && input != replacement) {
- if (replacement != NULL) return NoChange();
- replacement = input;
- }
- }
- DCHECK_NE(node, replacement);
- return Replace(replacement);
- }
-};
-}
-}
-} // namespace v8::internal::compiler
-
-#endif // V8_COMPILER_PHI_REDUCER_H_
« no previous file with comments | « BUILD.gn ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698