MLIR 22.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 name of the resource class.
36 StringRef getResource() const;
37
38 // Return the stage of the effect happen.
39 int64_t getStage() const;
40
41 // Return if this side effect act on every single value of resource.
42 bool getEffectOnfullRegion() const;
43
44 static bool classof(const Operator::VariableDecorator *var);
45};
46
47// This class represents an instance of a side effect interface applied to an
48// operation. This is a wrapper around an OpInterfaceTrait that also includes
49// the effects that are applied.
51public:
52 // Return the effects that are attached to the side effect interface.
54
55 // Return the name of the base C++ effect.
56 StringRef getBaseEffectName() const;
57
58 static bool classof(const Trait *t);
59};
60
61} // namespace tblgen
62} // namespace mlir
63
64#endif // MLIR_TABLEGEN_SIDEEFFECTS_H_
llvm::iterator_range< VariableDecoratorIterator > var_decorator_range
Definition Operator.h:133
StringRef getBaseEffectName() const
static bool classof(const Trait *t)
Operator::var_decorator_range getEffects() const
StringRef getName() const
std::string getInterfaceTrait() const
StringRef getBaseEffectName() 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:110