MLIR 24.0.0git
SideEffects.h
Go to the documentation of this file.
1//===- SideEffects.h - Side Effects classes ---------------------*- C++ -*-===//
2//
3// Part of the MLIR 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// Wrapper around side effect related classes defined in TableGen.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_TABLEGEN_SIDEEFFECTS_H_
14#define MLIR_TABLEGEN_SIDEEFFECTS_H_
15
16#include "mlir/Support/LLVM.h"
18
19namespace mlir {
20namespace tblgen {
21
22// This class represents a specific instance of an effect that is being
23// exhibited.
25public:
26 // Return the name of the C++ effect.
27 StringRef getName() const;
28
29 // Return the name of the base C++ effect.
30 StringRef getBaseEffectName() const;
31
32 // Return the name of the Interface that the effect belongs to.
33 std::string getInterfaceTrait() const;
34
35 // Return the C++ headers declaring the interface that the effect belongs to.
36 std::vector<StringRef> getCppIncludes() const;
37
38 // Return the name of the resource class.
39 StringRef getResource() const;
40
41 // Return the effect parameters attribute.
42 StringRef getParameters() const;
43
44 // Return the stage of the effect happen.
45 int64_t getStage() const;
46
47 // Return if this side effect act on every single value of resource.
48 bool getEffectOnfullRegion() const;
49
50 static bool classof(const Operator::VariableDecorator *var);
51};
52
53// This class represents an instance of a side effect interface applied to an
54// operation. This is a wrapper around an OpInterfaceTrait that also includes
55// the effects that are applied.
57public:
58 // Return the effects that are attached to the side effect interface.
60
61 // Return the name of the base C++ effect.
62 StringRef getBaseEffectName() const;
63
64 static bool classof(const Trait *t);
65};
66
67} // namespace tblgen
68} // namespace mlir
69
70#endif // MLIR_TABLEGEN_SIDEEFFECTS_H_
llvm::iterator_range< VariableDecoratorIterator > var_decorator_range
Definition Operator.h:141
StringRef getBaseEffectName() const
static bool classof(const Trait *t)
Operator::var_decorator_range getEffects() const
StringRef getParameters() const
StringRef getName() const
std::string getInterfaceTrait() const
StringRef getBaseEffectName() const
std::vector< StringRef > getCppIncludes() const
bool getEffectOnfullRegion() const
static bool classof(const Operator::VariableDecorator *var)
int64_t getStage() const
StringRef getResource() const
Include the generated interface declarations.
A class used to represent the decorators of an operator variable, i.e.
Definition Operator.h:118