1//===- CSE.h - Common Subexpression Elimination -----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares methods for eliminating common subexpressions.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_TRANSFORMS_CSE_H_
14#define MLIR_TRANSFORMS_CSE_H_
15
16namespace mlir {
17
18class DominanceInfo;
19class Operation;
20class RewriterBase;
21
22/// Eliminate common subexpressions within the given operation. This transform
23/// looks for and deduplicates equivalent operations.
24///
25/// `changed` indicates whether the IR was modified or not.
26void eliminateCommonSubExpressions(RewriterBase &rewriter,
27 DominanceInfo &domInfo, Operation *op,
28 bool *changed = nullptr);
29
30} // namespace mlir
31
32#endif // MLIR_TRANSFORMS_CSE_H_
33

source code of mlir/include/mlir/Transforms/CSE.h