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

Side by Side Diff: src/compiler/dead-code-elimination.h

Issue 1193833002: [turbofan] Proper dead code elimination as regular reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Renamed DeadControl to Dead. 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 unified diff | Download patch
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/dead-code-elimination.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_COMPILER_DEAD_CODE_ELIMINATION_H_
6 #define V8_COMPILER_DEAD_CODE_ELIMINATION_H_
7
8 #include "src/compiler/graph-reducer.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace compiler {
13
14 // Forward declarations.
15 class CommonOperatorBuilder;
16
17
18 // Propagates {Dead} control through the graph and thereby removes dead code.
19 // Note that this does not include trimming dead uses from the graph, and it
20 // also does not include detecting dead code by any other means than seeing a
21 // {Dead} control input; that is left to other reducers.
22 class DeadCodeElimination final : public AdvancedReducer {
23 public:
24 DeadCodeElimination(Editor* editor, Graph* graph,
25 CommonOperatorBuilder* common);
26 ~DeadCodeElimination() final {}
27
28 Reduction Reduce(Node* node) final;
29
30 private:
31 Reduction ReduceEnd(Node* node);
32 Reduction ReduceLoopOrMerge(Node* node);
33 Reduction ReduceNode(Node* node);
34
35 void TrimMergeOrPhi(Node* node, int size);
36
37 Graph* graph() const { return graph_; }
38 CommonOperatorBuilder* common() const { return common_; }
39 Node* dead() const { return dead_; }
40
41 Graph* const graph_;
42 CommonOperatorBuilder* const common_;
43 Node* const dead_;
44
45 DISALLOW_COPY_AND_ASSIGN(DeadCodeElimination);
46 };
47
48 } // namespace compiler
49 } // namespace internal
50 } // namespace v8
51
52 #endif // V8_COMPILER_DEAD_CODE_ELIMINATION_H_
OLDNEW
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/dead-code-elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698