MLIR 24.0.0git
DLTI.h
Go to the documentation of this file.
1//===- DLTI.h - Data Layout and Target Info MLIR Dialect --------*- 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// Defines the dialect containing the objects pertaining to target information.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_DIALECT_DLTI_DLTI_H
14#define MLIR_DIALECT_DLTI_DLTI_H
15
16#include "mlir/IR/Attributes.h"
18
19namespace mlir {
20namespace detail {
22} // namespace detail
23} // namespace mlir
24namespace mlir {
25namespace dlti {
26namespace detail {
27FailureOr<Attribute> queryDlti(Operation *op, DataLayoutEntryKey key);
28LogicalResult setDlti(Operation *op, DataLayoutEntryKey key, Attribute value);
29} // namespace detail
30
31/// Query the first key at `op` or the nearest ancestor that can answer it.
32/// Query later keys recursively on the returned attributes, without searching
33/// operation ancestors again.
34FailureOr<Attribute> query(Operation *op, ArrayRef<DataLayoutEntryKey> keys,
35 bool emitError = false);
36
37/// As above, using each string in `keys` as a DLTI entry key.
38FailureOr<Attribute> query(Operation *op, ArrayRef<StringRef> keys,
39 bool emitError = false);
40} // namespace dlti
41} // namespace mlir
42
43#include "mlir/Dialect/DLTI/DLTIOpInterfaces.h.inc"
44
45#define GET_ATTRDEF_CLASSES
46#include "mlir/Dialect/DLTI/DLTIAttrs.h.inc"
47#include "mlir/Dialect/DLTI/DLTIDialect.h.inc"
48
49#endif // MLIR_DIALECT_DLTI_DLTI_H
Attributes are known-constant values of operations.
Definition Attributes.h:25
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
AttrTypeReplacer.
LogicalResult setDlti(Operation *op, DataLayoutEntryKey key, Attribute value)
Definition DLTI.cpp:531
FailureOr< Attribute > queryDlti(Operation *op, DataLayoutEntryKey key)
Definition DLTI.cpp:523
FailureOr< Attribute > query(Operation *op, ArrayRef< DataLayoutEntryKey > keys, bool emitError=false)
Query the first key at op or the nearest ancestor that can answer it.
Definition DLTI.cpp:579
Include the generated interface declarations.
llvm::PointerUnion< Type, StringAttr > DataLayoutEntryKey
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.