MLIR  20.0.0git
SPIRVGLCanonicalization.cpp
Go to the documentation of this file.
1 //===- SPIRVGLCanonicalization.cpp - SPIR-V GLSL canonicalization patterns =//
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 // This file defines the canonicalization patterns for SPIR-V GLSL-specific ops.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 
16 
17 using namespace mlir;
18 
19 namespace {
20 #include "SPIRVCanonicalization.inc"
21 } // namespace
22 
23 namespace mlir {
24 namespace spirv {
26  results.add<ConvertComparisonIntoClamp1_SPIRV_FOrdLessThanOp,
27  ConvertComparisonIntoClamp1_SPIRV_FOrdLessThanEqualOp,
28  ConvertComparisonIntoClamp1_SPIRV_SLessThanOp,
29  ConvertComparisonIntoClamp1_SPIRV_SLessThanEqualOp,
30  ConvertComparisonIntoClamp1_SPIRV_ULessThanOp,
31  ConvertComparisonIntoClamp1_SPIRV_ULessThanEqualOp,
32  ConvertComparisonIntoClamp2_SPIRV_FOrdLessThanOp,
33  ConvertComparisonIntoClamp2_SPIRV_FOrdLessThanEqualOp,
34  ConvertComparisonIntoClamp2_SPIRV_SLessThanOp,
35  ConvertComparisonIntoClamp2_SPIRV_SLessThanEqualOp,
36  ConvertComparisonIntoClamp2_SPIRV_ULessThanOp,
37  ConvertComparisonIntoClamp2_SPIRV_ULessThanEqualOp>(
38  results.getContext());
39 }
40 } // namespace spirv
41 } // namespace mlir
MLIRContext * getContext() const
Definition: PatternMatch.h:829
RewritePatternSet & add(ConstructorArg &&arg, ConstructorArgs &&...args)
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
Definition: PatternMatch.h:853
void populateSPIRVGLCanonicalizationPatterns(RewritePatternSet &results)
Populates patterns to run canoncalization that involves GL ops.
Include the generated interface declarations.