1 //===- ConvertStandardToSPIRV.h - Convert to SPIR-V dialect -----*- 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 // Provides patterns to lower StandardOps to SPIR-V dialect. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRV_H 14 #define MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRV_H 15 16 #include "mlir/Transforms/DialectConversion.h" 17 18 namespace mlir { 19 class SPIRVTypeConverter; 20 21 /// Appends to a pattern list additional patterns for translating StandardOps to 22 /// SPIR-V ops. Also adds the patterns legalize ops not directly translated to 23 /// SPIR-V dialect. 24 void populateStandardToSPIRVPatterns(MLIRContext *context, 25 SPIRVTypeConverter &typeConverter, 26 OwningRewritePatternList &patterns); 27 28 /// Appends to a pattern list patterns to legalize ops that are not directly 29 /// lowered to SPIR-V. 30 void populateStdLegalizationPatternsForSPIRVLowering( 31 MLIRContext *context, OwningRewritePatternList &patterns); 32 33 } // namespace mlir 34 35 #endif // MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRV_H 36