1 //===------ TestCompositePass.cpp --- composite test pass -----------------===//
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
7 //===----------------------------------------------------------------------===//
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"
20 void registerTestCompositePass() {
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())
28 pm
.addPass(createCompositeFixedPointPass(
29 "TestCompositePass", [](OpPassManager
&p
) {
30 p
.addPass(createCanonicalizerPass());
31 p
.addPass(createCSEPass());
35 [](function_ref
<void(const detail::PassOptions
&)>) {});