blob: b882a3125fad2157136d3bf690471cb8bd966aca [file] [log] [blame]
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001// 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
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_SELECT_LOWERING_H_
6#define V8_COMPILER_SELECT_LOWERING_H_
7
Emily Bernierd0a1eb72015-03-24 16:35:39 -04008#include "src/compiler/graph-reducer.h"
Emily Bernierd0a1eb72015-03-24 16:35:39 -04009
10namespace v8 {
11namespace internal {
12namespace compiler {
13
14// Forward declarations.
15class CommonOperatorBuilder;
16class Graph;
17
18
19// Lowers Select nodes to diamonds.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000020class SelectLowering final : public Reducer {
Emily Bernierd0a1eb72015-03-24 16:35:39 -040021 public:
22 SelectLowering(Graph* graph, CommonOperatorBuilder* common);
23 ~SelectLowering();
24
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000025 Reduction Reduce(Node* node) override;
Emily Bernierd0a1eb72015-03-24 16:35:39 -040026
27 private:
Emily Bernierd0a1eb72015-03-24 16:35:39 -040028 CommonOperatorBuilder* common() const { return common_; }
29 Graph* graph() const { return graph_; }
30
31 CommonOperatorBuilder* common_;
32 Graph* graph_;
Emily Bernierd0a1eb72015-03-24 16:35:39 -040033};
34
35} // namespace compiler
36} // namespace internal
37} // namespace v8
38
39#endif // V8_COMPILER_SELECT_LOWERING_H_