MLIR 23.0.0git
OpenMPCommon.h
Go to the documentation of this file.
1//===- OpenMPCommon.h - Utils for translating MLIR dialect to LLVM IR------===//
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 general utilities for MLIR Dialect translations to LLVM IR.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_TARGET_LLVMIR_DIALECT_OPENMPCOMMON_H
14#define MLIR_TARGET_LLVMIR_DIALECT_OPENMPCOMMON_H
15
17#include "mlir/IR/Location.h"
18#include "mlir/Support/LLVM.h"
19
20#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
21#include "llvm/IR/IRBuilder.h"
22
23namespace mlir {
24namespace LLVM {
25
26/// Create a constant string location from the MLIR Location information.
27/// When \p ForOffloadMap is true, the layout matches Clang's
28/// \c emitMappingInformation (first \c ';'-delimited field is the map name for
29/// \c libomptarget). When false, the layout matches \c ident_t (file then
30/// function name in the encoded string).
31llvm::Constant *createSourceLocStrFromLocation(Location loc,
32 llvm::OpenMPIRBuilder &builder,
33 StringRef name, uint32_t &strLen,
34 bool ForOffloadMap = false);
35
36/// Create a constant string representing the mapping information extracted from
37/// the MLIR location information.
38llvm::Constant *createMappingInformation(Location loc,
39 llvm::OpenMPIRBuilder &builder);
40
41} // namespace LLVM
42} // namespace mlir
43
44#endif // MLIR_TARGET_LLVMIR_DIALECT_OPENMPCOMMON_H
llvm::Constant * createMappingInformation(Location loc, llvm::OpenMPIRBuilder &builder)
Create a constant string representing the mapping information extracted from the MLIR location inform...
llvm::Constant * createSourceLocStrFromLocation(Location loc, llvm::OpenMPIRBuilder &builder, StringRef name, uint32_t &strLen, bool ForOffloadMap=false)
Create a constant string location from the MLIR Location information.
Include the generated interface declarations.