1 //===- OpenMPToLLVM.h - Utils to convert from the OpenMP dialect ----------===// 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 #ifndef MLIR_CONVERSION_OPENMPTOLLVM_CONVERTOPENMPTOLLVM_H 9 #define MLIR_CONVERSION_OPENMPTOLLVM_CONVERTOPENMPTOLLVM_H 10 11 #include <memory> 12 13 namespace mlir { 14 class LLVMTypeConverter; 15 class ConversionTarget; 16 class MLIRContext; 17 class ModuleOp; 18 template <typename T> 19 class OperationPass; 20 class RewritePatternSet; 21 22 /// Configure dynamic conversion legality of regionless operations from OpenMP 23 /// to LLVM. 24 void configureOpenMPToLLVMConversionLegality(ConversionTarget &target, 25 LLVMTypeConverter &typeConverter); 26 27 /// Populate the given list with patterns that convert from OpenMP to LLVM. 28 void populateOpenMPToLLVMConversionPatterns(LLVMTypeConverter &converter, 29 RewritePatternSet &patterns); 30 31 /// Create a pass to convert OpenMP operations to the LLVMIR dialect. 32 std::unique_ptr<OperationPass<ModuleOp>> createConvertOpenMPToLLVMPass(); 33 34 } // namespace mlir 35 36 #endif // MLIR_CONVERSION_OPENMPTOLLVM_CONVERTOPENMPTOLLVM_H 37