summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2019-10-31 13:29:14 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-31 13:29:50 -0700
commit7432234f3c5ca2da83f152f9f0508244a3b01a18 (patch)
treefa496765c7b9b03a15c74eaf554a5cce78cd72cd
parentce9477934a5a7a266dda989f76c25b7a4cf60b09 (diff)
downloadbcm5719-llvm-7432234f3c5ca2da83f152f9f0508244a3b01a18.tar.gz
bcm5719-llvm-7432234f3c5ca2da83f152f9f0508244a3b01a18.zip
NFC: Use #ifndef in various .td files instead of #ifdef and #else
Upstream LLVM gained support for #ifndef with https://reviews.llvm.org/D61888 This is changed mechanically via the following command: find . -name "*.td" -exec sed -i -e ':a' -e 'N' -e '$!ba' -e 's/#ifdef \([A-Z_]*\)\n#else/#ifndef \1/g' {} \; PiperOrigin-RevId: 277789427
-rw-r--r--mlir/examples/toy/Ch2/include/toy/Ops.td6
-rw-r--r--mlir/examples/toy/Ch3/include/toy/Ops.td6
-rw-r--r--mlir/examples/toy/Ch4/include/toy/Ops.td9
-rw-r--r--mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td6
-rw-r--r--mlir/examples/toy/Ch5/include/toy/Ops.td9
-rw-r--r--mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td6
-rw-r--r--mlir/examples/toy/Ch6/include/toy/Ops.td9
-rw-r--r--mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td6
-rw-r--r--mlir/include/mlir/Analysis/CallInterfaces.td6
-rw-r--r--mlir/include/mlir/Analysis/InferTypeOpInterface.td6
-rw-r--r--mlir/include/mlir/Dialect/AffineOps/AffineOps.td9
-rw-r--r--mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td6
-rw-r--r--mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td6
-rw-r--r--mlir/include/mlir/Dialect/GPU/GPUOps.td6
-rw-r--r--mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td6
-rw-r--r--mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td3
-rw-r--r--mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td3
-rw-r--r--mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td3
-rw-r--r--mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td6
-rw-r--r--mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td9
-rw-r--r--mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td9
-rw-r--r--mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td3
-rw-r--r--mlir/include/mlir/Dialect/LoopOps/LoopOps.td9
-rw-r--r--mlir/include/mlir/Dialect/QuantOps/QuantOps.td6
-rw-r--r--mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td3
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td6
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td6
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td6
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td6
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td9
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td6
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td6
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td27
-rw-r--r--mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td6
-rw-r--r--mlir/include/mlir/Dialect/StandardOps/Ops.td6
-rw-r--r--mlir/include/mlir/Dialect/VectorOps/VectorOps.td6
-rw-r--r--mlir/include/mlir/IR/OpBase.td3
-rw-r--r--mlir/include/mlir/Transforms/LoopLikeInterface.td6
-rw-r--r--mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td9
-rw-r--r--mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td9
-rw-r--r--mlir/test/lib/TestDialect/TestOps.td3
-rw-r--r--mlir/test/mlir-tblgen/reference-impl.td3
42 files changed, 93 insertions, 186 deletions
diff --git a/mlir/examples/toy/Ch2/include/toy/Ops.td b/mlir/examples/toy/Ch2/include/toy/Ops.td
index 28b8d31ea92..206d339f832 100644
--- a/mlir/examples/toy/Ch2/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch2/include/toy/Ops.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef TOY_OPS
-#else
+#ifndef TOY_OPS
#define TOY_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/examples/toy/Ch3/include/toy/Ops.td b/mlir/examples/toy/Ch3/include/toy/Ops.td
index 37f3dda2ab0..0cd4115df8d 100644
--- a/mlir/examples/toy/Ch3/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch3/include/toy/Ops.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef TOY_OPS
-#else
+#ifndef TOY_OPS
#define TOY_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/examples/toy/Ch4/include/toy/Ops.td b/mlir/examples/toy/Ch4/include/toy/Ops.td
index 8ccff79adce..eb73dde5d3f 100644
--- a/mlir/examples/toy/Ch4/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch4/include/toy/Ops.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef TOY_OPS
-#else
+#ifndef TOY_OPS
#define TOY_OPS
-#ifdef MLIR_CALLINTERFACES
-#else
+#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES
-#ifdef SHAPE_INFERENCE_INTERFACE
-#else
+#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE
diff --git a/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td
index 4958b01fd27..dc345907ac7 100644
--- a/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td
+++ b/mlir/examples/toy/Ch4/include/toy/ShapeInferenceInterface.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SHAPE_INFERENCE_INTERFACE
-#else
+#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/examples/toy/Ch5/include/toy/Ops.td b/mlir/examples/toy/Ch5/include/toy/Ops.td
index 0eb30a7e022..a38c4e3d12d 100644
--- a/mlir/examples/toy/Ch5/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch5/include/toy/Ops.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef TOY_OPS
-#else
+#ifndef TOY_OPS
#define TOY_OPS
-#ifdef MLIR_CALLINTERFACES
-#else
+#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES
-#ifdef SHAPE_INFERENCE_INTERFACE
-#else
+#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE
diff --git a/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td
index 4958b01fd27..dc345907ac7 100644
--- a/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td
+++ b/mlir/examples/toy/Ch5/include/toy/ShapeInferenceInterface.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SHAPE_INFERENCE_INTERFACE
-#else
+#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/examples/toy/Ch6/include/toy/Ops.td b/mlir/examples/toy/Ch6/include/toy/Ops.td
index 0eb30a7e022..a38c4e3d12d 100644
--- a/mlir/examples/toy/Ch6/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch6/include/toy/Ops.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef TOY_OPS
-#else
+#ifndef TOY_OPS
#define TOY_OPS
-#ifdef MLIR_CALLINTERFACES
-#else
+#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES
-#ifdef SHAPE_INFERENCE_INTERFACE
-#else
+#ifndef SHAPE_INFERENCE_INTERFACE
include "toy/ShapeInferenceInterface.td"
#endif // SHAPE_INFERENCE_INTERFACE
diff --git a/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td b/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td
index 4958b01fd27..dc345907ac7 100644
--- a/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td
+++ b/mlir/examples/toy/Ch6/include/toy/ShapeInferenceInterface.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SHAPE_INFERENCE_INTERFACE
-#else
+#ifndef SHAPE_INFERENCE_INTERFACE
#define SHAPE_INFERENCE_INTERFACE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Analysis/CallInterfaces.td b/mlir/include/mlir/Analysis/CallInterfaces.td
index 3ed802f07f4..67440b21455 100644
--- a/mlir/include/mlir/Analysis/CallInterfaces.td
+++ b/mlir/include/mlir/Analysis/CallInterfaces.td
@@ -21,12 +21,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef MLIR_CALLINTERFACES
-#else
+#ifndef MLIR_CALLINTERFACES
#define MLIR_CALLINTERFACES
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.td b/mlir/include/mlir/Analysis/InferTypeOpInterface.td
index 71377966f9d..addd0b35320 100644
--- a/mlir/include/mlir/Analysis/InferTypeOpInterface.td
+++ b/mlir/include/mlir/Analysis/InferTypeOpInterface.td
@@ -20,12 +20,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef MLIR_INFERTYPEOPINTERFACE
-#else
+#ifndef MLIR_INFERTYPEOPINTERFACE
#define MLIR_INFERTYPEOPINTERFACE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/AffineOps/AffineOps.td b/mlir/include/mlir/Dialect/AffineOps/AffineOps.td
index c1c72325781..f54c5146901 100644
--- a/mlir/include/mlir/Dialect/AffineOps/AffineOps.td
+++ b/mlir/include/mlir/Dialect/AffineOps/AffineOps.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef AFFINE_OPS
-#else
+#ifndef AFFINE_OPS
#define AFFINE_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
-#ifdef MLIR_LOOPLIKEINTERFACE
-#else
+#ifndef MLIR_LOOPLIKEINTERFACE
include "mlir/Transforms/LoopLikeInterface.td"
#endif
diff --git a/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td b/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td
index fb4439a43ac..2d6eb148f8e 100644
--- a/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td
+++ b/mlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef AFFINE_OPS_BASE
-#else
+#ifndef AFFINE_OPS_BASE
#define AFFINE_OPS_BASE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td b/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td
index 3f0772f9dda..aa8b7ecbe7e 100644
--- a/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td
+++ b/mlir/include/mlir/Dialect/FxpMathOps/FxpMathOps.td
@@ -20,11 +20,9 @@
//
//===----------------------------------------------------------------------===//
-#ifdef DIALECT_FXPMATHOPS_FXPMATH_OPS_
-#else
+#ifndef DIALECT_FXPMATHOPS_FXPMATH_OPS_
#define DIALECT_FXPMATHOPS_FXPMATH_OPS_
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td
index 9c0ab8e7f02..a620d106d48 100644
--- a/mlir/include/mlir/Dialect/GPU/GPUOps.td
+++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef GPU_OPS
-#else
+#ifndef GPU_OPS
#define GPU_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
index a68cdbf3da0..37c8315cf77 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
@@ -20,12 +20,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef LLVMIR_OP_BASE
-#else
+#ifndef LLVMIR_OP_BASE
#define LLVMIR_OP_BASE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index 41fcae68a0d..d781f58902c 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -19,8 +19,7 @@
//
//===----------------------------------------------------------------------===//
-#ifdef LLVMIR_OPS
-#else
+#ifndef LLVMIR_OPS
#define LLVMIR_OPS
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
index d952089e717..41fad10a3f8 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
@@ -19,8 +19,7 @@
//
//===----------------------------------------------------------------------===//
-#ifdef NVVMIR_OPS
-#else
+#ifndef NVVMIR_OPS
#define NVVMIR_OPS
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index fb078a70bff..79d4136d6f5 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -19,8 +19,7 @@
//
//===----------------------------------------------------------------------===//
-#ifdef ROCDLIR_OPS
-#else
+#ifndef ROCDLIR_OPS
#define ROCDLIR_OPS
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
index 1984056d88f..a2c302f9ddc 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
@@ -19,13 +19,11 @@
//
//===----------------------------------------------------------------------===//
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
-#ifdef LINALG_BASE
-#else
+#ifndef LINALG_BASE
#define LINALG_BASE
def Linalg_Dialect : Dialect {
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
index a4a76cc602e..bf422aafd0c 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
@@ -20,17 +20,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef LINALG_LIBRARY_OPS
-#else
+#ifndef LINALG_LIBRARY_OPS
#define LINALG_LIBRARY_OPS
-#ifdef AFFINE_OPS_BASE
-#else
+#ifndef AFFINE_OPS_BASE
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
#endif // AFFINE_OPS_BASE
-#ifdef LINALG_BASE
-#else
+#ifndef LINALG_BASE
include "mlir/Dialect/Linalg/IR/LinalgBase.td"
#endif // LINALG_BASE
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
index b865b5fa616..00185416b73 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef LINALG_OPS
-#else
+#ifndef LINALG_OPS
#define LINALG_OPS
-#ifdef AFFINE_OPS_BASE
-#else
+#ifndef AFFINE_OPS_BASE
include "mlir/Dialect/AffineOps/AffineOpsBase.td"
#endif // AFFINE_OPS_BASE
-#ifdef LINALG_BASE
-#else
+#ifndef LINALG_BASE
include "mlir/Dialect/Linalg/IR/LinalgBase.td"
#endif // LINALG_BASE
diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td b/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td
index fdb467737ab..aef7e76f859 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/LinalgTransformPatterns.td
@@ -19,8 +19,7 @@
//
//===----------------------------------------------------------------------===//
-#ifdef LINALG_TRANSFORMS
-#else
+#ifndef LINALG_TRANSFORMS
#define LINALG_TRANSFORMS
include "mlir/Dialect/Linalg/IR/LinalgOps.td"
diff --git a/mlir/include/mlir/Dialect/LoopOps/LoopOps.td b/mlir/include/mlir/Dialect/LoopOps/LoopOps.td
index 3afab04ba6e..6f228a216fb 100644
--- a/mlir/include/mlir/Dialect/LoopOps/LoopOps.td
+++ b/mlir/include/mlir/Dialect/LoopOps/LoopOps.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef LOOP_OPS
-#else
+#ifndef LOOP_OPS
#define LOOP_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
-#ifdef MLIR_LOOPLIKEINTERFACE
-#else
+#ifndef MLIR_LOOPLIKEINTERFACE
include "mlir/Transforms/LoopLikeInterface.td"
#endif
diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantOps.td b/mlir/include/mlir/Dialect/QuantOps/QuantOps.td
index 761f6ce3403..48a15985ddc 100644
--- a/mlir/include/mlir/Dialect/QuantOps/QuantOps.td
+++ b/mlir/include/mlir/Dialect/QuantOps/QuantOps.td
@@ -19,11 +19,9 @@
//
//===----------------------------------------------------------------------===//
-#ifdef DIALECT_QUANTOPS_QUANT_OPS_
-#else
+#ifndef DIALECT_QUANTOPS_QUANT_OPS_
#define DIALECT_QUANTOPS_QUANT_OPS_
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
include "mlir/Dialect/QuantOps/QuantPredicates.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td b/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td
index 4940b015331..2fbb7995dd4 100644
--- a/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td
+++ b/mlir/include/mlir/Dialect/QuantOps/QuantPredicates.td
@@ -19,8 +19,7 @@
//
//===----------------------------------------------------------------------===//
-#ifdef DIALECT_QUANTOPS_QUANT_PREDICATES_
-#else
+#ifndef DIALECT_QUANTOPS_QUANT_PREDICATES_
#define DIALECT_QUANTOPS_QUANT_PREDICATES_
//===----------------------------------------------------------------------===//
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
index ec36357e324..65542757ad7 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
@@ -20,12 +20,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_ARITHMETIC_OPS
-#else
+#ifndef SPIRV_ARITHMETIC_OPS
#define SPIRV_ARITHMETIC_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
index 6dbf28f877c..253217bd678 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
@@ -21,12 +21,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
#define SPIRV_BASE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td
index 8c8e8c03711..9cbb15ee5e6 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td
@@ -20,12 +20,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_BIT_OPS
-#else
+#ifndef SPIRV_BIT_OPS
#define SPIRV_BIT_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td
index 1e90707008d..245a2248948 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td
@@ -20,12 +20,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_CAST_OPS
-#else
+#ifndef SPIRV_CAST_OPS
#define SPIRV_CAST_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
index 5c9eab819e2..070d6a6c5ad 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
@@ -20,17 +20,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_CONTROLFLOW_OPS
-#else
+#ifndef SPIRV_CONTROLFLOW_OPS
#define SPIRV_CONTROLFLOW_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
-#ifdef MLIR_CALLINTERFACES
-#else
+#ifndef MLIR_CALLINTERFACES
include "mlir/Analysis/CallInterfaces.td"
#endif // MLIR_CALLINTERFACES
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
index 9f2430a0867..7d5ae763017 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_GLSL_OPS
-#else
+#ifndef SPIRV_GLSL_OPS
#define SPIRV_GLSL_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/Dialect/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
index 5bb9f37dc81..1387a854f60 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
@@ -20,12 +20,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_LOGICAL_OPS
-#else
+#ifndef SPIRV_LOGICAL_OPS
#define SPIRV_LOGICAL_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
index 4e310c67107..0e135c573f6 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
@@ -26,48 +26,39 @@
// op traits, arguments, results, and sections after the results are retained.
// Besides, ops in this file must be separated via the '// -----' marker.
-#ifdef SPIRV_OPS
-#else
+#ifndef SPIRV_OPS
#define SPIRV_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/Dialect/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
-#ifdef SPIRV_ARITHMETIC_OPS
-#else
+#ifndef SPIRV_ARITHMETIC_OPS
include "mlir/Dialect/SPIRV/SPIRVArithmeticOps.td"
#endif // SPIRV_ARITHMETIC_OPS
-#ifdef SPIRV_BIT_OPS
-#else
+#ifndef SPIRV_BIT_OPS
include "mlir/Dialect/SPIRV/SPIRVBitOps.td"
#endif // SPIRV_BIT_OPS
-#ifdef SPIRV_CAST_OPS
-#else
+#ifndef SPIRV_CAST_OPS
include "mlir/Dialect/SPIRV/SPIRVCastOps.td"
#endif // SPIRV_CAST_OPS
-#ifdef SPIRV_CONTROLFLOW_OPS
-#else
+#ifndef SPIRV_CONTROLFLOW_OPS
include "mlir/Dialect/SPIRV/SPIRVControlFlowOps.td"
#endif // SPIRV_CONTROLFLOW_OPS
-#ifdef SPIRV_LOGICAL_OPS
-#else
+#ifndef SPIRV_LOGICAL_OPS
include "mlir/Dialect/SPIRV/SPIRVLogicalOps.td"
#endif // SPIRV_LOGICAL_OPS
-#ifdef SPIRV_STRUCTURE_OPS
-#else
+#ifndef SPIRV_STRUCTURE_OPS
// Pull in ops for defining the SPIR-V module structure
include "mlir/Dialect/SPIRV/SPIRVStructureOps.td"
#endif // SPIRV_STRUCTURE_OPS
-#ifdef SPIRV_GLSL_OPS
-#else
+#ifndef SPIRV_GLSL_OPS
// Pull in ops for extended instruction set for GLSL
include "mlir/Dialect/SPIRV/SPIRVGLSLOps.td"
#endif // SPIRV_GLSL_OPS
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
index 19c42cca16f..aadd17940af 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
@@ -21,12 +21,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef SPIRV_STRUCTURE_OPS
-#else
+#ifndef SPIRV_STRUCTURE_OPS
#define SPIRV_STRUCTURE_OPS
-#ifdef SPIRV_BASE
-#else
+#ifndef SPIRV_BASE
include "mlir/SPIRV/SPIRVBase.td"
#endif // SPIRV_BASE
diff --git a/mlir/include/mlir/Dialect/StandardOps/Ops.td b/mlir/include/mlir/Dialect/StandardOps/Ops.td
index d675812cb47..ff640077fb8 100644
--- a/mlir/include/mlir/Dialect/StandardOps/Ops.td
+++ b/mlir/include/mlir/Dialect/StandardOps/Ops.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef STANDARD_OPS
-#else
+#ifndef STANDARD_OPS
#define STANDARD_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/Dialect/VectorOps/VectorOps.td b/mlir/include/mlir/Dialect/VectorOps/VectorOps.td
index f63660dc30c..032312e72cf 100644
--- a/mlir/include/mlir/Dialect/VectorOps/VectorOps.td
+++ b/mlir/include/mlir/Dialect/VectorOps/VectorOps.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef VECTOR_OPS
-#else
+#ifndef VECTOR_OPS
#define VECTOR_OPS
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td
index d8ad2e4dc21..b57c549d205 100644
--- a/mlir/include/mlir/IR/OpBase.td
+++ b/mlir/include/mlir/IR/OpBase.td
@@ -19,8 +19,7 @@
//
//===----------------------------------------------------------------------===//
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
#define OP_BASE
//===----------------------------------------------------------------------===//
diff --git a/mlir/include/mlir/Transforms/LoopLikeInterface.td b/mlir/include/mlir/Transforms/LoopLikeInterface.td
index a7479cab4a9..4ba89170bcf 100644
--- a/mlir/include/mlir/Transforms/LoopLikeInterface.td
+++ b/mlir/include/mlir/Transforms/LoopLikeInterface.td
@@ -19,12 +19,10 @@
//
//===----------------------------------------------------------------------===//
-#ifdef MLIR_LOOPLIKEINTERFACE
-#else
+#ifndef MLIR_LOOPLIKEINTERFACE
#define MLIR_LOOPLIKEINTERFACE
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
diff --git a/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td b/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td
index 2b89b721d83..5c940699934 100644
--- a/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td
+++ b/mlir/lib/Conversion/GPUToNVVM/GPUToNVVM.td
@@ -19,17 +19,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef MLIR_CONVERSION_GPUTONVVM_TD
-#else
+#ifndef MLIR_CONVERSION_GPUTONVVM_TD
#define MLIR_CONVERSION_GPUTONVVM_TD
-#ifdef GPU_OPS
-#else
+#ifndef GPU_OPS
include "mlir/Dialect/GPU/GPUOps.td"
#endif // GPU_OPS
-#ifdef NVVMIR_OPS
-#else
+#ifndef NVVMIR_OPS
include "mlir/Dialect/LLVMIR/NVVMOps.td"
#endif // NVVMIR_OPS
diff --git a/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
index d9b217bcf09..769ec583599 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
+++ b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
@@ -10,17 +10,14 @@
//
//===----------------------------------------------------------------------===//
-#ifdef MLIR_CONVERSION_STANDARDTOSPIRV_TD
-#else
+#ifndef MLIR_CONVERSION_STANDARDTOSPIRV_TD
#define MLIR_CONVERSION_STANDARDTOSPIRV_TD
-#ifdef STANDARD_OPS
-#else
+#ifndef STANDARD_OPS
include "mlir/Dialect/StandardOps/Ops.td"
#endif // STANDARD_OPS
-#ifdef SPIRV_OPS
-#else
+#ifndef SPIRV_OPS
include "mlir/Dialect/SPIRV/SPIRVOps.td"
#endif // SPIRV_OPS
diff --git a/mlir/test/lib/TestDialect/TestOps.td b/mlir/test/lib/TestDialect/TestOps.td
index 09603e0fc18..94b0250a436 100644
--- a/mlir/test/lib/TestDialect/TestOps.td
+++ b/mlir/test/lib/TestDialect/TestOps.td
@@ -15,8 +15,7 @@
// limitations under the License.
// =============================================================================
-#ifdef TEST_OPS
-#else
+#ifndef TEST_OPS
#define TEST_OPS
include "mlir/IR/OpBase.td"
diff --git a/mlir/test/mlir-tblgen/reference-impl.td b/mlir/test/mlir-tblgen/reference-impl.td
index c62335a5be1..53cb70509e8 100644
--- a/mlir/test/mlir-tblgen/reference-impl.td
+++ b/mlir/test/mlir-tblgen/reference-impl.td
@@ -1,7 +1,6 @@
// RUN: mlir-tblgen -gen-reference-implementations -I %S/../../include %s | FileCheck %s
-#ifdef OP_BASE
-#else
+#ifndef OP_BASE
include "mlir/IR/OpBase.td"
#endif // OP_BASE
OpenPOWER on IntegriCloud