//===- ComplexToSPIRV.cpp - Complex to SPIR-V Patterns --------------------===// // // 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 // //===----------------------------------------------------------------------===// // // This file implements patterns to convert Complex dialect to SPIR-V dialect. // //===----------------------------------------------------------------------===// #include "mlir/Conversion/ComplexToSPIRV/ComplexToSPIRV.h" #include "mlir/Dialect/Complex/IR/Complex.h" #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/Support/Debug.h" #define DEBUG_TYPE … usingnamespacemlir; //===----------------------------------------------------------------------===// // Operation conversion //===----------------------------------------------------------------------===// namespace { struct ConstantOpPattern final : OpConversionPattern<complex::ConstantOp> { … }; struct CreateOpPattern final : OpConversionPattern<complex::CreateOp> { … }; struct ReOpPattern final : OpConversionPattern<complex::ReOp> { … }; struct ImOpPattern final : OpConversionPattern<complex::ImOp> { … }; } // namespace //===----------------------------------------------------------------------===// // Pattern population //===----------------------------------------------------------------------===// void mlir::populateComplexToSPIRVPatterns(SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) { … }