File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
mlir/include/mlir/Target/LLVMIR/Transforms Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ // ===- TargetUtils.h - Utils to obtain LLVM's TargetMachine and DataLayout ===//
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_TARGET_LLVMIR_TRANSFORMS_TARGETUTILS_H
10+ #define MLIR_TARGET_LLVMIR_TRANSFORMS_TARGETUTILS_H
11+
12+ #include " mlir/Dialect/LLVMIR/LLVMInterfaces.h"
13+ #include " llvm/Support/Threading.h"
14+ #include " llvm/Target/TargetMachine.h"
15+
16+ namespace mlir {
17+ namespace LLVM {
18+ namespace detail {
19+ // / Idempotent helper to register/initialize all backends that LLVM has been
20+ // / configured to support. Only runs the first time it is called.
21+ void initializeBackendsOnce ();
22+
23+ // / Helper to obtain the TargetMachine specified by the properties of the
24+ // / TargetAttrInterface-implementing attribute.
25+ FailureOr<std::unique_ptr<llvm::TargetMachine>>
26+ getTargetMachine (mlir::LLVM::TargetAttrInterface attr);
27+
28+ // / Helper to obtain the DataLayout of the target specified by the properties of
29+ // / the TargetAttrInterface-implementing attribute.
30+ FailureOr<llvm::DataLayout> getDataLayout (mlir::LLVM::TargetAttrInterface attr);
31+ } // namespace detail
32+ } // namespace LLVM
33+ } // namespace mlir
34+
35+ #endif // MLIR_TARGET_LLVMIR_TRANSFORMS_TARGETUTILS_H
You can’t perform that action at this time.
0 commit comments