Skip to content

Commit

Permalink
NFC: Remove unnecessarily guarded tablegen includes.
Browse files Browse the repository at this point in the history
Support for including a file multiple times was added in tablegen, removing the need for these extra guards. This is because we already insert c/c++ style header guards within each of the specific .td files.

PiperOrigin-RevId: 282076728
  • Loading branch information
River707 authored and tensorflower-gardener committed Nov 23, 2019
1 parent 9a62ec8 commit b8ee563
Show file tree
Hide file tree
Showing 45 changed files with 12 additions and 163 deletions.
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch2/include/toy/Ops.td
Expand Up @@ -22,9 +22,7 @@
#ifndef TOY_OPS
#define TOY_OPS

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

// Provide a definition of the 'toy' dialect in the ODS framework so that we
// can define our operations.
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch3/include/toy/Ops.td
Expand Up @@ -22,9 +22,7 @@
#ifndef TOY_OPS
#define TOY_OPS

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

// Provide a definition of the 'toy' dialect in the ODS framework so that we
// can define our operations.
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch3/mlir/ToyCombine.td
Expand Up @@ -23,9 +23,7 @@
#ifndef TOY_COMBINE
#define TOY_COMBINE

#ifndef OP_BASE
include "toy/Ops.td"
#endif // OP_BASE

/// Note: The DRR definition used for defining patterns is shown below:
///
Expand Down
5 changes: 0 additions & 5 deletions mlir/examples/toy/Ch4/include/toy/Ops.td
Expand Up @@ -22,13 +22,8 @@
#ifndef TOY_OPS
#define TOY_OPS

#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES

#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE

// Provide a definition of the 'toy' dialect in the ODS framework so that we
// can define our operations.
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td
Expand Up @@ -22,9 +22,7 @@
#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

def ShapeInferenceOpInterface : OpInterface<"ShapeInference"> {
let description = [{
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch4/mlir/ToyCombine.td
Expand Up @@ -23,9 +23,7 @@
#ifndef TOY_COMBINE
#define TOY_COMBINE

#ifndef OP_BASE
include "toy/Ops.td"
#endif // OP_BASE

/// Note: The DRR definition used for defining patterns is shown below:
///
Expand Down
5 changes: 0 additions & 5 deletions mlir/examples/toy/Ch5/include/toy/Ops.td
Expand Up @@ -22,13 +22,8 @@
#ifndef TOY_OPS
#define TOY_OPS

#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES

#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE

// Provide a definition of the 'toy' dialect in the ODS framework so that we
// can define our operations.
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td
Expand Up @@ -22,9 +22,7 @@
#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

def ShapeInferenceOpInterface : OpInterface<"ShapeInference"> {
let description = [{
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch5/mlir/ToyCombine.td
Expand Up @@ -23,9 +23,7 @@
#ifndef TOY_COMBINE
#define TOY_COMBINE

#ifndef OP_BASE
include "toy/Ops.td"
#endif // OP_BASE

/// Note: The DRR definition used for defining patterns is shown below:
///
Expand Down
5 changes: 0 additions & 5 deletions mlir/examples/toy/Ch6/include/toy/Ops.td
Expand Up @@ -22,13 +22,8 @@
#ifndef TOY_OPS
#define TOY_OPS

#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES

#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE

// Provide a definition of the 'toy' dialect in the ODS framework so that we
// can define our operations.
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td
Expand Up @@ -22,9 +22,7 @@
#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

def ShapeInferenceOpInterface : OpInterface<"ShapeInference"> {
let description = [{
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch6/mlir/ToyCombine.td
Expand Up @@ -23,9 +23,7 @@
#ifndef TOY_COMBINE
#define TOY_COMBINE

#ifndef OP_BASE
include "toy/Ops.td"
#endif // OP_BASE

/// Note: The DRR definition used for defining patterns is shown below:
///
Expand Down
5 changes: 0 additions & 5 deletions mlir/examples/toy/Ch7/include/toy/Ops.td
Expand Up @@ -22,13 +22,8 @@
#ifndef TOY_OPS
#define TOY_OPS

#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES

#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE

// Provide a definition of the 'toy' dialect in the ODS framework so that we
// can define our operations.
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch7/include/toy/ShapeInferenceInterface.td
Expand Up @@ -22,9 +22,7 @@
#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

def ShapeInferenceOpInterface : OpInterface<"ShapeInference"> {
let description = [{
Expand Down
2 changes: 0 additions & 2 deletions mlir/examples/toy/Ch7/mlir/ToyCombine.td
Expand Up @@ -23,9 +23,7 @@
#ifndef TOY_COMBINE
#define TOY_COMBINE

#ifndef OP_BASE
include "toy/Ops.td"
#endif // OP_BASE

/// Note: The DRR definition used for defining patterns is shown below:
///
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Analysis/CallInterfaces.td
Expand Up @@ -24,9 +24,7 @@
#ifndef MLIR_CALLINTERFACES
#define MLIR_CALLINTERFACES

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

// `CallInterfaceCallable`: This is a type used to represent a single callable
// region. A callable is either a symbol, or an SSA value, that is referenced by
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Analysis/InferTypeOpInterface.td
Expand Up @@ -23,9 +23,7 @@
#ifndef MLIR_INFERTYPEOPINTERFACE
#define MLIR_INFERTYPEOPINTERFACE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

// OpInterface to compute the return type of an operation. The arguments match
// those in Operation::create with the exception that the location is optional
Expand Down
8 changes: 1 addition & 7 deletions mlir/include/mlir/Dialect/AffineOps/AffineOps.td
Expand Up @@ -22,15 +22,9 @@
#ifndef AFFINE_OPS
#define AFFINE_OPS

#ifndef OP_BASE
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
include "mlir/IR/OpBase.td"
#endif // OP_BASE

#ifndef MLIR_LOOPLIKEINTERFACE
include "mlir/Transforms/LoopLikeInterface.td"
#endif

include "mlir/Dialect/AffineOps/AffineOpsBase.td"

def Affine_Dialect : Dialect {
let name = "affine";
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td
Expand Up @@ -22,9 +22,7 @@
#ifndef AFFINE_OPS_BASE
#define AFFINE_OPS_BASE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

// Attributes containing affine maps.
def AffineMapAttr : Attr<
Expand Down
4 changes: 1 addition & 3 deletions mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td
Expand Up @@ -22,10 +22,8 @@

#ifndef DIALECT_FXPMATHOPS_FXPMATH_OPS_
#define DIALECT_FXPMATHOPS_FXPMATH_OPS_
#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

include "mlir/IR/OpBase.td"
include "mlir/Dialect/QuantOps/QuantPredicates.td"

def fxpmath_Dialect : Dialect {
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Dialect/GPU/GPUOps.td
Expand Up @@ -22,9 +22,7 @@
#ifndef GPU_OPS
#define GPU_OPS

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

def GPU_Dialect : Dialect {
let name = "gpu";
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
Expand Up @@ -23,9 +23,7 @@
#ifndef LLVMIR_OP_BASE
#define LLVMIR_OP_BASE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

def LLVM_Dialect : Dialect {
let name = "llvm";
Expand Down
6 changes: 2 additions & 4 deletions mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
Expand Up @@ -19,13 +19,11 @@
//
//===----------------------------------------------------------------------===//

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

#ifndef LINALG_BASE
#define LINALG_BASE

include "mlir/IR/OpBase.td"

def Linalg_Dialect : Dialect {
let name = "linalg";
let description = [{
Expand Down
5 changes: 0 additions & 5 deletions mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
Expand Up @@ -23,13 +23,8 @@
#ifndef LINALG_LIBRARY_OPS
#define LINALG_LIBRARY_OPS

#ifndef AFFINE_OPS_BASE
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
#endif // AFFINE_OPS_BASE

#ifndef LINALG_BASE
include "mlir/Dialect/Linalg/IR/LinalgBase.td"
#endif // LINALG_BASE

class LinalgParametricNativeOpTrait<string prop, string parameters> :
NativeOpTrait<"linalg::" # prop # parameters>
Expand Down
5 changes: 0 additions & 5 deletions mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
Expand Up @@ -22,13 +22,8 @@
#ifndef LINALG_OPS
#define LINALG_OPS

#ifndef AFFINE_OPS_BASE
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
#endif // AFFINE_OPS_BASE

#ifndef LINALG_BASE
include "mlir/Dialect/Linalg/IR/LinalgBase.td"
#endif // LINALG_BASE

// Base class for Linalg dialect ops that do not correspond to library calls.
class Linalg_Op<string mnemonic, list<OpTrait> traits = []> :
Expand Down
Expand Up @@ -22,12 +22,8 @@
#ifndef LINALG_TRANSFORMS
#define LINALG_TRANSFORMS

#ifndef LINALG_OPS
include "mlir/Dialect/Linalg/IR/LinalgOps.td"
#endif // LINALG_OPS
#ifndef LINALG_LIBRARY_OPS
include "mlir/Dialect/Linalg/IR/LinalgLibraryOps.td"
#endif // LINALG_LIBRARY_OPS

def HasNoLinalgTransformMarker : CPred<[{
!$0.getAttrOfType<StringAttr>(LinalgTransforms::kLinalgTransformMarker)
Expand Down
5 changes: 0 additions & 5 deletions mlir/include/mlir/Dialect/LoopOps/LoopOps.td
Expand Up @@ -22,13 +22,8 @@
#ifndef LOOP_OPS
#define LOOP_OPS

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

#ifndef MLIR_LOOPLIKEINTERFACE
include "mlir/Transforms/LoopLikeInterface.td"
#endif

def Loop_Dialect : Dialect {
let name = "loop";
Expand Down
3 changes: 1 addition & 2 deletions mlir/include/mlir/Dialect/QuantOps/QuantOps.td
Expand Up @@ -21,10 +21,9 @@

#ifndef DIALECT_QUANTOPS_QUANT_OPS_
#define DIALECT_QUANTOPS_QUANT_OPS_
#ifndef OP_BASE

include "mlir/IR/OpBase.td"
include "mlir/Dialect/QuantOps/QuantPredicates.td"
#endif // OP_BASE

def quant_Dialect : Dialect {
let name = "quant";
Expand Down
4 changes: 1 addition & 3 deletions mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
Expand Up @@ -23,9 +23,7 @@
#ifndef SPIRV_ARITHMETIC_OPS
#define SPIRV_ARITHMETIC_OPS

#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
include "mlir/Dialect/SPIRV/SPIRVBase.td"

class SPV_ArithmeticBinaryOp<string mnemonic, Type type,
list<OpTrait> traits = []> :
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
Expand Up @@ -24,9 +24,7 @@
#ifndef SPIRV_BASE
#define SPIRV_BASE

#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE

//===----------------------------------------------------------------------===//
// SPIR-V dialect definitions
Expand Down
4 changes: 1 addition & 3 deletions mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td
Expand Up @@ -23,9 +23,7 @@
#ifndef SPIRV_BIT_OPS
#define SPIRV_BIT_OPS

#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
include "mlir/Dialect/SPIRV/SPIRVBase.td"

class SPV_BitBinaryOp<string mnemonic, list<OpTrait> traits = []> :
// All the operands type used in bit instructions are SPV_Integer.
Expand Down
4 changes: 1 addition & 3 deletions mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td
Expand Up @@ -23,9 +23,7 @@
#ifndef SPIRV_CAST_OPS
#define SPIRV_CAST_OPS

#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
include "mlir/Dialect/SPIRV/SPIRVBase.td"

class SPV_CastOp<string mnemonic, Type resultType, Type operandType,
list<OpTrait> traits = []> :
Expand Down
7 changes: 1 addition & 6 deletions mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
Expand Up @@ -23,13 +23,8 @@
#ifndef SPIRV_CONTROLFLOW_OPS
#define SPIRV_CONTROLFLOW_OPS

#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE

#ifndef MLIR_CALLINTERFACES
include "mlir/Dialect/SPIRV/SPIRVBase.td"
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES

// -----

Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
Expand Up @@ -22,9 +22,7 @@
#ifndef SPIRV_GLSL_OPS
#define SPIRV_GLSL_OPS

#ifndef SPIRV_BASE
include "mlir/Dialect/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE

//===----------------------------------------------------------------------===//
// SPIR-V GLSL 4.50 opcode specification.
Expand Down

0 comments on commit b8ee563

Please sign in to comment.