MLIR  20.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"
17 #include "mlir/TableGen/Operator.h"
18 
19 namespace mlir {
20 namespace tblgen {
21 
22 // This class represents a specific instance of an effect that is being
23 // exhibited.
25 public:
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.
51 public:
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_
StringRef getBaseEffectName() const
Definition: SideEffects.cpp:58
static bool classof(const Trait *t)
Definition: SideEffects.cpp:62
Operator::var_decorator_range getEffects() const
Definition: SideEffects.cpp:53
StringRef getName() const
Definition: SideEffects.cpp:20
std::string getInterfaceTrait() const
Definition: SideEffects.cpp:28
StringRef getBaseEffectName() const
Definition: SideEffects.cpp:24
bool getEffectOnfullRegion() const
Definition: SideEffects.cpp:41
static bool classof(const Operator::VariableDecorator *var)
Definition: SideEffects.cpp:45
int64_t getStage() const
Definition: SideEffects.cpp:39
StringRef getResource() const
Definition: SideEffects.cpp:35
Include the generated interface declarations.
A class used to represent the decorators of an operator variable, i.e.
Definition: Operator.h:110