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"
17#include "mlir/IR/Dialect.h"
19
20namespace mlir {
21namespace detail {
23} // namespace detail
24} // namespace mlir
25namespace mlir {
26namespace dlti {
27namespace detail {
28FailureOr<Attribute> queryDlti(Operation *op, DataLayoutEntryKey key);
29LogicalResult setDlti(Operation *op, DataLayoutEntryKey key, Attribute value);
30} // namespace detail
31
32/// Query the first key at `op` or the nearest ancestor that can answer it.
33/// Query later keys recursively on the returned attributes, without searching
34/// operation ancestors again.
35FailureOr<Attribute> query(Operation *op, ArrayRef<DataLayoutEntryKey> keys,
36 bool emitError = false);
37
38/// As above, using each string in `keys` as a DLTI entry key.
39FailureOr<Attribute> query(Operation *op, ArrayRef<StringRef> keys,
40 bool emitError = false);
41} // namespace dlti
42} // namespace mlir
43
44#include "mlir/Dialect/DLTI/DLTIOpInterfaces.h.inc"
45
46#define GET_ATTRDEF_CLASSES
47#include "mlir/Dialect/DLTI/DLTIAttrs.h.inc"
48#include "mlir/Dialect/DLTI/DLTIDialect.h.inc"
49
50#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:532
FailureOr< Attribute > queryDlti(Operation *op, DataLayoutEntryKey key)
Definition DLTI.cpp:524
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:580
Include the generated interface declarations.
llvm::PointerUnion< Type, StringAttr > DataLayoutEntryKey
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.