MLIR  22.0.0git
ArithToAMDGPU.h
Go to the documentation of this file.
1 //===- ArithToAMDGPU.h - Arith to AMDGPU dialect conversion ---*- 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 #ifndef MLIR_CONVERSION_ARITHTOAMDGPU_ARITHTOAMDGPU_H
10 #define MLIR_CONVERSION_ARITHTOAMDGPU_ARITHTOAMDGPU_H
11 
13 #include "mlir/IR/PatternMatch.h"
14 #include <memory>
15 #include <string>
16 
17 namespace mlir {
18 
19 class RewritePatternSet;
20 class Pass;
21 
22 #define GEN_PASS_DECL_ARITHTOAMDGPUCONVERSIONPASS
23 #include "mlir/Conversion/Passes.h.inc"
24 
25 namespace arith {
26 /// Add patterns for rewriting `arith.extf` and `arith.truncf` on FP8 types
27 /// to wrappers around AMDGPU--specific intrinsics. If `saturateFP8TruncF`
28 /// is set, values outside the range of the destination type are clamped
29 /// to the largest value of that type instead of being rewritten to Inf (aka
30 /// NaN).
32  bool convertFP8Arithmetic,
33  bool saturateFP8Truncf,
34  bool allowPackedF16Rtz,
35  amdgpu::Chipset chipset,
36  PatternBenefit benefit = 1);
37 } // namespace arith
38 } // namespace mlir
39 
40 #endif // MLIR_CONVERSION_ARITHTOAMDGPU_ARITHTOAMDGPU_H
void populateArithToAMDGPUConversionPatterns(RewritePatternSet &patterns, bool convertFP8Arithmetic, bool saturateFP8Truncf, bool allowPackedF16Rtz, amdgpu::Chipset chipset, PatternBenefit benefit=1)
Add patterns for rewriting arith.extf and arith.truncf on FP8 types to wrappers around AMDGPU–specifi...
Include the generated interface declarations.
const FrozenRewritePatternSet & patterns