MLIR  20.0.0git
ControlFlowToLLVM.h
Go to the documentation of this file.
1 //===- ControlFlowToLLVM.h - ControlFlow to LLVM -----------*- 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 // Define conversions from the ControlFlow dialect to the LLVM IR dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_CONVERSION_CONTROLFLOWTOLLVM_CONTROLFLOWTOLLVM_H
14 #define MLIR_CONVERSION_CONTROLFLOWTOLLVM_CONTROLFLOWTOLLVM_H
15 
16 #include <memory>
17 
18 namespace mlir {
19 class DialectRegistry;
20 class LLVMTypeConverter;
21 class RewritePatternSet;
22 class Pass;
23 
24 #define GEN_PASS_DECL_CONVERTCONTROLFLOWTOLLVMPASS
25 #include "mlir/Conversion/Passes.h.inc"
26 
27 namespace cf {
28 
29 /// Collect the patterns to convert from the ControlFlow dialect to LLVM. The
30 /// conversion patterns capture the LLVMTypeConverter by reference meaning the
31 /// references have to remain alive during the entire pattern lifetime.
33  const LLVMTypeConverter &converter, RewritePatternSet &patterns);
34 
35 /// Populate the cf.assert to LLVM conversion pattern. If `abortOnFailure` is
36 /// set to false, the program execution continues when a condition is
37 /// unsatisfied.
39  RewritePatternSet &patterns,
40  bool abortOnFailure = true);
41 
43 
44 } // namespace cf
45 } // namespace mlir
46 
47 #endif // MLIR_CONVERSION_CONTROLFLOWTOLLVM_CONTROLFLOWTOLLVM_H
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Conversion from types to the LLVM IR dialect.
Definition: TypeConverter.h:35
void populateAssertToLLVMConversionPattern(const LLVMTypeConverter &converter, RewritePatternSet &patterns, bool abortOnFailure=true)
Populate the cf.assert to LLVM conversion pattern.
void registerConvertControlFlowToLLVMInterface(DialectRegistry &registry)
void populateControlFlowToLLVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Collect the patterns to convert from the ControlFlow dialect to LLVM.
Include the generated interface declarations.