1// Copyright 2016 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_CHECKPOINT_ELIMINATION_H_
6#define V8_COMPILER_CHECKPOINT_ELIMINATION_H_
7
8#include "src/base/compiler-specific.h"
9#include "src/common/globals.h"
10#include "src/compiler/graph-reducer.h"
11
12namespace v8 {
13namespace internal {
14namespace compiler {
15
16// Performs elimination of redundant checkpoints within the graph.
17class V8_EXPORT_PRIVATE CheckpointElimination final
18    : public NON_EXPORTED_BASE(AdvancedReducer) {
19 public:
20  explicit CheckpointElimination(Editor* editor);
21  ~CheckpointElimination() final = default;
22
23  const char* reducer_name() const override { return "CheckpointElimination"; }
24
25  Reduction Reduce(Node* node) final;
26
27 private:
28  Reduction ReduceCheckpoint(Node* node);
29};
30
31}  // namespace compiler
32}  // namespace internal
33}  // namespace v8
34
35#endif  // V8_COMPILER_CHECKPOINT_ELIMINATION_H_
36