//===- TestConstantFold.cpp - Pass to test constant folding ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "mlir/Pass/Pass.h" #include "mlir/Transforms/FoldUtils.h" usingnamespacemlir; namespace { /// Simple constant folding pass. struct TestConstantFold : public PassWrapper<TestConstantFold, OperationPass<>>, public RewriterBase::Listener { … }; } // namespace void TestConstantFold::foldOperation(Operation *op, OperationFolder &helper) { … } void TestConstantFold::runOnOperation() { … } namespace mlir { namespace test { void registerTestConstantFold() { … } } // namespace test } // namespace mlir