File: Interpreter.h

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (87 lines) | stat: -rw-r--r-- 3,747 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//===-- mlir-c/Dialect/Transform/Interpreter.h --------------------*- C -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// C interface to the transform dialect interpreter.
//
//===----------------------------------------------------------------------===//

#include "mlir-c/IR.h"
#include "mlir-c/Support.h"

#ifdef __cplusplus
extern "C" {
#endif

#define DEFINE_C_API_STRUCT(name, storage)                                     \
  struct name {                                                                \
    storage *ptr;                                                              \
  };                                                                           \
  typedef struct name name

DEFINE_C_API_STRUCT(MlirTransformOptions, void);

#undef DEFINE_C_API_STRUCT

//----------------------------------------------------------------------------//
// MlirTransformOptions
//----------------------------------------------------------------------------//

/// Creates a default-initialized transform options object.
MLIR_CAPI_EXPORTED MlirTransformOptions mlirTransformOptionsCreate(void);

/// Enables or disables expensive checks in transform options.
MLIR_CAPI_EXPORTED void
mlirTransformOptionsEnableExpensiveChecks(MlirTransformOptions transformOptions,
                                          bool enable);

/// Returns true if expensive checks are enabled in transform options.
MLIR_CAPI_EXPORTED bool mlirTransformOptionsGetExpensiveChecksEnabled(
    MlirTransformOptions transformOptions);

/// Enables or disables the enforcement of the top-level transform op being
/// single in transform options.
MLIR_CAPI_EXPORTED void mlirTransformOptionsEnforceSingleTopLevelTransformOp(
    MlirTransformOptions transformOptions, bool enable);

/// Returns true if the enforcement of the top-level transform op being single
/// is enabled in transform options.
MLIR_CAPI_EXPORTED bool mlirTransformOptionsGetEnforceSingleTopLevelTransformOp(
    MlirTransformOptions transformOptions);

/// Destroys a transform options object previously created by
/// mlirTransformOptionsCreate.
MLIR_CAPI_EXPORTED void
mlirTransformOptionsDestroy(MlirTransformOptions transformOptions);

//----------------------------------------------------------------------------//
// Transform interpreter and utilities.
//----------------------------------------------------------------------------//

/// Applies the transformation script starting at the given transform root
/// operation to the given payload operation. The module containing the
/// transform root as well as the transform options should be provided. The
/// transform operation must implement TransformOpInterface and the module must
/// be a ModuleOp. Returns the status of the application.
MLIR_CAPI_EXPORTED MlirLogicalResult mlirTransformApplyNamedSequence(
    MlirOperation payload, MlirOperation transformRoot,
    MlirOperation transformModule, MlirTransformOptions transformOptions);

/// Merge the symbols from `other` into `target`, potentially renaming them to
/// avoid conflicts. Private symbols may be renamed during the merge, public
/// symbols must have at most one declaration. A name conflict in public symbols
/// is reported as an error before returning a failure.
///
/// Note that this clones the `other` operation unlike the C++ counterpart that
/// takes ownership.
MLIR_CAPI_EXPORTED MlirLogicalResult
mlirMergeSymbolsIntoFromClone(MlirOperation target, MlirOperation other);

#ifdef __cplusplus
}
#endif