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 LLVMTypeConverter; 20 class RewritePatternSet; 21 class Pass; 22 23 namespace cf { 24 /// Collect the patterns to convert from the ControlFlow dialect to LLVM. The 25 /// conversion patterns capture the LLVMTypeConverter by reference meaning the 26 /// references have to remain alive during the entire pattern lifetime. 27 void populateControlFlowToLLVMConversionPatterns(LLVMTypeConverter &converter, 28 RewritePatternSet &patterns); 29 30 /// Creates a pass to convert the ControlFlow dialect into the LLVMIR dialect. 31 std::unique_ptr<Pass> createConvertControlFlowToLLVMPass(); 32 } // namespace cf 33 } // namespace mlir 34 35 #endif // MLIR_CONVERSION_CONTROLFLOWTOLLVM_CONTROLFLOWTOLLVM_H 36