[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / lib / Transforms / TestCompositePass.cpp
blob5c0d93cc0d64ec1e3dee805fd182fcac10d005c7
1 //===------ TestCompositePass.cpp --- composite test pass -----------------===//
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 implements a pass to test the composite pass utility.
11 //===----------------------------------------------------------------------===//
13 #include "mlir/Pass/Pass.h"
14 #include "mlir/Pass/PassManager.h"
15 #include "mlir/Pass/PassRegistry.h"
16 #include "mlir/Transforms/Passes.h"
18 namespace mlir {
19 namespace test {
20 void registerTestCompositePass() {
21 registerPassPipeline(
22 "test-composite-fixed-point-pass", "Test composite pass",
23 [](OpPassManager &pm, StringRef optionsStr,
24 function_ref<LogicalResult(const Twine &)> errorHandler) {
25 if (!optionsStr.empty())
26 return failure();
28 pm.addPass(createCompositeFixedPointPass(
29 "TestCompositePass", [](OpPassManager &p) {
30 p.addPass(createCanonicalizerPass());
31 p.addPass(createCSEPass());
32 }));
33 return success();
35 [](function_ref<void(const detail::PassOptions &)>) {});
37 } // namespace test
38 } // namespace mlir