forked from OSchip/llvm-project
[mlir][SideEffects][NFC] Move the .td definitions for NoSideEffect/RecursiveSideEffect to SideEffects.td
This matches the location of these traits within the source files. Differential Revision: https://reviews.llvm.org/D75968
This commit is contained in:
parent
d5f53253a0
commit
483f82b146
|
@ -14,6 +14,7 @@
|
|||
#define TOY_OPS
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// Provide a definition of the 'toy' dialect in the ODS framework so that we
|
||||
// can define our operations.
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef TOY_OPS
|
||||
#define TOY_OPS
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// Provide a definition of the 'toy' dialect in the ODS framework so that we
|
||||
// can define our operations.
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define TOY_OPS
|
||||
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
include "toy/ShapeInferenceInterface.td"
|
||||
|
||||
// Provide a definition of the 'toy' dialect in the ODS framework so that we
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define TOY_OPS
|
||||
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
include "toy/ShapeInferenceInterface.td"
|
||||
|
||||
// Provide a definition of the 'toy' dialect in the ODS framework so that we
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define TOY_OPS
|
||||
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
include "toy/ShapeInferenceInterface.td"
|
||||
|
||||
// Provide a definition of the 'toy' dialect in the ODS framework so that we
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define TOY_OPS
|
||||
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
include "toy/ShapeInferenceInterface.td"
|
||||
|
||||
// Provide a definition of the 'toy' dialect in the ODS framework so that we
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#define AFFINE_OPS
|
||||
|
||||
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
include "mlir/Transforms/LoopLikeInterface.td"
|
||||
|
||||
def Affine_Dialect : Dialect {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Dialect/QuantOps/QuantPredicates.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
def fxpmath_Dialect : Dialect {
|
||||
let name = "fxpmath";
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
#ifndef GPU_OPS
|
||||
#define GPU_OPS
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// Type constraint accepting standard integers, indices and wrapped LLVM integer
|
||||
// types.
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
|
||||
include "mlir/Interfaces/ControlFlowInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
class LLVM_Builder<string builder> {
|
||||
string llvmBuilder = builder;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define NVVMIR_OPS
|
||||
|
||||
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// NVVM dialect definitions
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define ROCDLIR_OPS
|
||||
|
||||
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ROCDL dialect definitions
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
|
||||
include "mlir/Dialect/Linalg/IR/LinalgBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// Base class for Linalg dialect ops that do not correspond to library calls.
|
||||
class Linalg_Op<string mnemonic, list<OpTrait> traits = []> :
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef LOOP_OPS
|
||||
#define LOOP_OPS
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
include "mlir/Transforms/LoopLikeInterface.td"
|
||||
|
||||
def Loop_Dialect : Dialect {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Dialect/QuantOps/QuantPredicates.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
def quant_Dialect : Dialect {
|
||||
let name = "quant";
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define SPIRV_ARITHMETIC_OPS
|
||||
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
class SPV_ArithmeticBinaryOp<string mnemonic, Type type,
|
||||
list<OpTrait> traits = []> :
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define SPIRV_BIT_OPS
|
||||
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
class SPV_BitBinaryOp<string mnemonic, list<OpTrait> traits = []> :
|
||||
// All the operands type used in bit instructions are SPV_Integer.
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define SPIRV_CAST_OPS
|
||||
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
class SPV_CastOp<string mnemonic, Type resultType, Type operandType,
|
||||
list<OpTrait> traits = []> :
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define SPIRV_COMPOSITE_OPS
|
||||
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// -----
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/ControlFlowInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// -----
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define SPIRV_GLSL_OPS
|
||||
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// SPIR-V GLSL 4.50 opcode specification.
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define SPIRV_LOGICAL_OPS
|
||||
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
class SPV_LogicalBinaryOp<string mnemonic, Type operandsType,
|
||||
list<OpTrait> traits = []> :
|
||||
|
|
|
@ -33,6 +33,7 @@ include "mlir/Dialect/SPIRV/SPIRVGroupOps.td"
|
|||
include "mlir/Dialect/SPIRV/SPIRVLogicalOps.td"
|
||||
include "mlir/Dialect/SPIRV/SPIRVNonUniformOps.td"
|
||||
include "mlir/Dialect/SPIRV/SPIRVStructureOps.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// -----
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
#ifndef SPIRV_STRUCTURE_OPS
|
||||
#define SPIRV_STRUCTURE_OPS
|
||||
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Dialect/SPIRV/SPIRVBase.td"
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
// -----
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
#ifndef STANDARD_OPS
|
||||
#define STANDARD_OPS
|
||||
|
||||
include "mlir/IR/OpAsmInterface.td"
|
||||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/ControlFlowInterfaces.td"
|
||||
include "mlir/IR/OpAsmInterface.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
def Std_Dialect : Dialect {
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
#ifndef VECTOR_OPS
|
||||
#define VECTOR_OPS
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
def Vector_Dialect : Dialect {
|
||||
let name = "vector";
|
||||
|
|
|
@ -1555,10 +1555,6 @@ def FunctionLike : NativeOpTrait<"FunctionLike">;
|
|||
def IsolatedFromAbove : NativeOpTrait<"IsIsolatedFromAbove">;
|
||||
// Op results are float or vectors/tensors thereof.
|
||||
def ResultsAreFloatLike : NativeOpTrait<"ResultsAreFloatLike">;
|
||||
// Op has no side effect.
|
||||
def NoSideEffect : NativeOpTrait<"HasNoSideEffect">;
|
||||
// Op has recursively computed side effects.
|
||||
def RecursiveSideEffects : NativeOpTrait<"HasRecursiveSideEffects">;
|
||||
// Op has the same operand type.
|
||||
def SameTypeOperands : NativeOpTrait<"SameTypeOperands">;
|
||||
// Op has same shape for all operands.
|
||||
|
|
|
@ -188,4 +188,13 @@ class MemWrite<string resourceName>
|
|||
: MemoryEffect<"MemoryEffects::Write", resourceName>;
|
||||
def MemWrite : MemWrite<"">;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Effect Traits
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Op has no side effect.
|
||||
def NoSideEffect : NativeOpTrait<"HasNoSideEffect">;
|
||||
// Op has recursively computed side effects.
|
||||
def RecursiveSideEffects : NativeOpTrait<"HasRecursiveSideEffects">;
|
||||
|
||||
#endif // MLIR_INTERFACES_SIDEEFFECTS
|
||||
|
|
|
@ -15,6 +15,7 @@ include "mlir/Interfaces/SideEffects.td"
|
|||
include "mlir/Interfaces/CallInterfaces.td"
|
||||
include "mlir/Interfaces/ControlFlowInterfaces.td"
|
||||
include "mlir/Interfaces/InferTypeOpInterface.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
def TEST_Dialect : Dialect {
|
||||
let name = "test";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// RUN: mlir-tblgen -gen-op-decls -I %S/../../include %s | FileCheck --dump-input-on-failure %s
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
include "mlir/Interfaces/SideEffects.td"
|
||||
|
||||
def Test_Dialect : Dialect {
|
||||
let name = "test";
|
||||
|
|
|
@ -225,7 +225,8 @@ static bool emitIntrinsic(const llvm::Record &record, llvm::raw_ostream &os) {
|
|||
static bool emitIntrinsics(const llvm::RecordKeeper &records,
|
||||
llvm::raw_ostream &os) {
|
||||
llvm::emitSourceFileHeader("Operations for LLVM intrinsics", os);
|
||||
os << "include \"mlir/Dialect/LLVMIR/LLVMOpBase.td\"\n\n";
|
||||
os << "include \"mlir/Dialect/LLVMIR/LLVMOpBase.td\"\n";
|
||||
os << "include \"mlir/Interfaces/SideEffects.td\"\n\n";
|
||||
|
||||
auto defs = records.getAllDerivedDefinitions("Intrinsic");
|
||||
for (const llvm::Record *r : defs) {
|
||||
|
|
Loading…
Reference in New Issue