[mlir][spirv] NFC: Shuffle code around to better follow convention
commit01178654121b1caadadd448d65d7fb4f806670d6
authorLei Zhang <antiagainst@google.com>
Thu, 17 Dec 2020 15:55:45 +0000 (17 10:55 -0500)
committerLei Zhang <antiagainst@google.com>
Thu, 17 Dec 2020 16:03:26 +0000 (17 11:03 -0500)
treeb60013ed0cbac3fc0f9a98361d04b353e51b7eea
parentd20e0c3444ad9ada550d9d6d1d56fd72948ae444
[mlir][spirv] NFC: Shuffle code around to better follow convention

This commit shuffles SPIR-V code around to better follow MLIR
convention. Specifically,

* Created IR/, Transforms/, Linking/, and Utils/ subdirectories and
  moved suitable code inside.
* Created SPIRVEnums.{h|cpp} for SPIR-V C/C++ enums generated from
  SPIR-V spec. Previously they are cluttered inside SPIRVTypes.{h|cpp}.
* Fixed include guards in various header files (both .h and .td).
* Moved serialization tests under test/Target/SPIRV.
* Renamed TableGen backend -gen-spirv-op-utils into -gen-spirv-attr-utils
  as it is only generating utility functions for attributes.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D93407
144 files changed:
mlir/docs/Dialects/SPIR-V.md
mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
mlir/include/mlir/Dialect/SPIRV/IR/CMakeLists.txt [copied from mlir/include/mlir/Dialect/SPIRV/CMakeLists.txt with 80% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/ParserUtils.h [moved from mlir/include/mlir/Dialect/SPIRV/ParserUtils.h with 87% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVArithmeticOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td with 98% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVAtomicOps.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.h [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVAttributes.h with 91% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAvailability.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVAvailability.td with 96% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVBase.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBitOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVBitOps.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCastOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVCastOps.td with 98% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVCompositeOps.td with 97% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td with 98% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVCooperativeMatrixOps.td with 98% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVDialect.h [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h with 77% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVEnums.h [new file with mode: 0644]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGLSLOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td with 98% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMatrixOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVMatrixOps.td with 97% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVModule.h [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVModule.h with 82% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVNonUniformOps.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOCLOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVOCLOps.td with 96% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h with 78% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td with 94% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td with 99% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVTypes.h [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h with 89% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/TargetAndABI.h [moved from mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h with 96% similarity]
mlir/include/mlir/Dialect/SPIRV/IR/TargetAndABI.td [moved from mlir/include/mlir/Dialect/SPIRV/TargetAndABI.td with 95% similarity]
mlir/include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h [moved from mlir/include/mlir/Dialect/SPIRV/ModuleCombiner.h with 93% similarity]
mlir/include/mlir/Dialect/SPIRV/Transforms/CMakeLists.txt [new file with mode: 0644]
mlir/include/mlir/Dialect/SPIRV/Transforms/Passes.h [moved from mlir/include/mlir/Dialect/SPIRV/Passes.h with 87% similarity]
mlir/include/mlir/Dialect/SPIRV/Transforms/Passes.td [moved from mlir/include/mlir/Dialect/SPIRV/Passes.td with 91% similarity]
mlir/include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h [moved from mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h with 92% similarity]
mlir/include/mlir/Dialect/SPIRV/Utils/LayoutUtils.h [moved from mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h with 92% similarity]
mlir/include/mlir/InitAllDialects.h
mlir/include/mlir/InitAllPasses.h
mlir/include/mlir/Target/SPIRV/SPIRVBinaryUtils.h
mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.td
mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp
mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.cpp
mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt
mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
mlir/lib/Conversion/SPIRVToLLVM/CMakeLists.txt
mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.cpp
mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
mlir/lib/Conversion/VectorToSPIRV/CMakeLists.txt
mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt [copied from mlir/lib/Dialect/SPIRV/CMakeLists.txt with 85% similarity]
mlir/lib/Dialect/SPIRV/IR/SPIRVAttributes.cpp [moved from mlir/lib/Dialect/SPIRV/SPIRVAttributes.cpp with 96% similarity]
mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp [moved from mlir/lib/Dialect/SPIRV/SPIRVCanonicalization.cpp with 99% similarity]
mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.td [moved from mlir/lib/Dialect/SPIRV/SPIRVCanonicalization.td with 97% similarity]
mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp [moved from mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp with 99% similarity]
mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp [moved from mlir/lib/Dialect/SPIRV/SPIRVOps.cpp with 99% similarity]
mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp [moved from mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp with 91% similarity]
mlir/lib/Dialect/SPIRV/IR/TargetAndABI.cpp [moved from mlir/lib/Dialect/SPIRV/TargetAndABI.cpp with 98% similarity]
mlir/lib/Dialect/SPIRV/Linking/ModuleCombiner/ModuleCombiner.cpp
mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
mlir/lib/Dialect/SPIRV/Transforms/DecorateCompositeTypeLayoutPass.cpp [moved from mlir/lib/Dialect/SPIRV/Transforms/DecorateSPIRVCompositeTypeLayoutPass.cpp with 93% similarity]
mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
mlir/lib/Dialect/SPIRV/Transforms/PassDetail.h
mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp
mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp [moved from mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp with 99% similarity]
mlir/lib/Dialect/SPIRV/Transforms/UpdateVCEPass.cpp
mlir/lib/Dialect/SPIRV/Utils/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/Utils/LayoutUtils.cpp [moved from mlir/lib/Dialect/SPIRV/LayoutUtils.cpp with 97% similarity]
mlir/lib/Target/SPIRV/Deserialization.cpp
mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp
mlir/lib/Target/SPIRV/Serialization.cpp
mlir/lib/Target/SPIRV/TranslateRegistration.cpp
mlir/test/Dialect/SPIRV/IR/arithmetic-ops.mlir [moved from mlir/test/Dialect/SPIRV/arithmetic-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/atomic-ops.mlir [moved from mlir/test/Dialect/SPIRV/atomic-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/availability.mlir [moved from mlir/test/Dialect/SPIRV/availability.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/bit-ops.mlir [moved from mlir/test/Dialect/SPIRV/bit-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/composite-ops.mlir [moved from mlir/test/Dialect/SPIRV/composite-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/control-flow-ops.mlir [moved from mlir/test/Dialect/SPIRV/control-flow-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/cooperative-matrix-ops.mlir [moved from mlir/test/Dialect/SPIRV/cooperative-matrix.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/glsl-ops.mlir [moved from mlir/test/Dialect/SPIRV/glslops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/group-ops.mlir [moved from mlir/test/Dialect/SPIRV/group-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/logical-ops.mlir [moved from mlir/test/Dialect/SPIRV/logical-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/matrix-ops.mlir [moved from mlir/test/Dialect/SPIRV/matrix-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir [moved from mlir/test/Dialect/SPIRV/non-uniform-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/ocl-ops.mlir [moved from mlir/test/Dialect/SPIRV/ocl-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/ops.mlir [moved from mlir/test/Dialect/SPIRV/ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/structure-ops.mlir [moved from mlir/test/Dialect/SPIRV/structure-ops.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/target-and-abi.mlir [moved from mlir/test/Dialect/SPIRV/target-and-abi.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/target-env.mlir [moved from mlir/test/Dialect/SPIRV/target-env.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/IR/types.mlir [moved from mlir/test/Dialect/SPIRV/types.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict-resolution.mlir [moved from mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict_resolution.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/deduplication.mlir [moved from mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/deduplication_basic.mlir with 100% similarity]
mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir [moved from mlir/test/Dialect/SPIRV/canonicalize.mlir with 100% similarity]
mlir/test/Target/SPIRV/arithmetic-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/arithmetic-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/array.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/array.mlir with 100% similarity]
mlir/test/Target/SPIRV/atomic-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/atomic-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/barrier.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/barrier.mlir with 100% similarity]
mlir/test/Target/SPIRV/bit-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/bit-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/cast-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/cast-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/composite-op.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/composite-op.mlir with 100% similarity]
mlir/test/Target/SPIRV/constant.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/constant.mlir with 100% similarity]
mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/cooperative-matrix.mlir with 100% similarity]
mlir/test/Target/SPIRV/debug.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/debug.mlir with 100% similarity]
mlir/test/Target/SPIRV/decorations.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/decorations.mlir with 100% similarity]
mlir/test/Target/SPIRV/entry-point.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/entry-point.mlir with 100% similarity]
mlir/test/Target/SPIRV/execution-mode.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/execution-mode.mlir with 100% similarity]
mlir/test/Target/SPIRV/function-call.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/function-call.mlir with 100% similarity]
mlir/test/Target/SPIRV/global-variable.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/global-variable.mlir with 100% similarity]
mlir/test/Target/SPIRV/glsl-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/glsl-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/group-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/group-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/logical-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/logical-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/loop.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/loop.mlir with 100% similarity]
mlir/test/Target/SPIRV/matrix.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/matrix.mlir with 100% similarity]
mlir/test/Target/SPIRV/memory-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/memory-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/module.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/module.mlir with 100% similarity]
mlir/test/Target/SPIRV/non-uniform-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/non-uniform-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/ocl-ops.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/ocl-ops.mlir with 100% similarity]
mlir/test/Target/SPIRV/phi.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/phi.mlir with 100% similarity]
mlir/test/Target/SPIRV/selection.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/selection.mlir with 100% similarity]
mlir/test/Target/SPIRV/spec-constant.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/spec-constant.mlir with 100% similarity]
mlir/test/Target/SPIRV/struct.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/struct.mlir with 100% similarity]
mlir/test/Target/SPIRV/terminator.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/terminator.mlir with 100% similarity]
mlir/test/Target/SPIRV/undef.mlir [moved from mlir/test/Dialect/SPIRV/Serialization/undef.mlir with 100% similarity]
mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp
mlir/test/lib/Dialect/SPIRV/TestModuleCombiner.cpp
mlir/test/lib/Transforms/TestGpuMemoryPromotion.cpp
mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt
mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp
mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
mlir/unittests/Dialect/SPIRV/SerializationTest.cpp