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
13#include "mlir/Dialect/SPIRV/IR/SPIRVGLCanonicalization.h"
14
15#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
16
17using namespace mlir;
18
19namespace {
20#include "SPIRVCanonicalization.inc"
21} // namespace
22
23namespace mlir {
24namespace spirv {
25void populateSPIRVGLCanonicalizationPatterns(RewritePatternSet &results) {
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
42

source code of mlir/lib/Dialect/SPIRV/IR/SPIRVGLCanonicalization.cpp