MLIR  19.0.0git
SCFToSPIRV.h
Go to the documentation of this file.
1 //===- SCFToSPIRV.h - SCF to SPIR-V Patterns --------------------*- 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 convert SCF dialect to SPIR-V dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRV_H_
13 #define MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRV_H_
14 
15 #include <memory>
16 
17 namespace mlir {
18 class Pass;
19 
20 // Owning list of rewriting patterns.
21 class SPIRVTypeConverter;
22 struct ScfToSPIRVContextImpl;
23 class RewritePatternSet;
24 
28 
29  ScfToSPIRVContextImpl *getImpl() { return impl.get(); }
30 
31 private:
32  std::unique_ptr<ScfToSPIRVContextImpl> impl;
33 };
34 
35 /// Collects a set of patterns to lower from scf.for, scf.if, and
36 /// loop.terminator to CFG operations within the SPIR-V dialect.
37 void populateSCFToSPIRVPatterns(SPIRVTypeConverter &typeConverter,
38  ScfToSPIRVContext &scfToSPIRVContext,
39  RewritePatternSet &patterns);
40 } // namespace mlir
41 
42 #endif // MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRV_H_
Include the generated interface declarations.
void populateSCFToSPIRVPatterns(SPIRVTypeConverter &typeConverter, ScfToSPIRVContext &scfToSPIRVContext, RewritePatternSet &patterns)
Collects a set of patterns to lower from scf.for, scf.if, and loop.terminator to CFG operations withi...
Definition: SCFToSPIRV.cpp:439
ScfToSPIRVContextImpl * getImpl()
Definition: SCFToSPIRV.h:29
ScfToSPIRVContext()
We use ScfToSPIRVContext to store information about the lowering of the scf region that need to be us...
Definition: SCFToSPIRV.cpp:43