[llvm-branch-commits] [mlir] 930c74f - [mlir][spirv] NFC: rename SPIR-V conversion files for consistency
Lei Zhang via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 23 11:41:37 PST 2020
Author: Lei Zhang
Date: 2020-12-23T14:36:46-05:00
New Revision: 930c74f12d799c95e37a107bb692148b36493806
URL: https://github.com/llvm/llvm-project/commit/930c74f12d799c95e37a107bb692148b36493806
DIFF: https://github.com/llvm/llvm-project/commit/930c74f12d799c95e37a107bb692148b36493806.diff
LOG: [mlir][spirv] NFC: rename SPIR-V conversion files for consistency
This commit renames various SPIR-V related conversion files for
consistency. It drops the "Convert" prefix to various files and
fixes various comment headers.
Reviewed By: hanchung, ThomasRaoux
Differential Revision: https://reviews.llvm.org/D93489
Added:
mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h
mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h
mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h
mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h
mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h
mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h
mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h
mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.cpp
mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp
mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRVPass.cpp
mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRVPass.cpp
Modified:
mlir/docs/Dialects/SPIR-V.md
mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h
mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h
mlir/include/mlir/Conversion/Passes.h
mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h
mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h
mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
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/SCFToSPIRV/SCFToSPIRVPass.cpp
mlir/lib/Conversion/SPIRVToLLVM/CMakeLists.txt
mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
mlir/lib/Conversion/VectorToSPIRV/CMakeLists.txt
mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp
mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp
Removed:
mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h
mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h
mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h
mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h
mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h
mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h
mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRV.h
mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.cpp
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
################################################################################
diff --git a/mlir/docs/Dialects/SPIR-V.md b/mlir/docs/Dialects/SPIR-V.md
index f30d82fd2810..acace47c2c6f 100644
--- a/mlir/docs/Dialects/SPIR-V.md
+++ b/mlir/docs/Dialects/SPIR-V.md
@@ -1145,7 +1145,7 @@ in a few places:
are at [lib/Conversion/StandardToSPIRV][MlirStdToSpirvLibs].
These dialect to dialect conversions have their dedicated libraries,
-`MLIRGPUToSPIRVTransforms` and `MLIRStandardToSPIRVTransforms`, respectively.
+`MLIRGPUToSPIRV` and `MLIRStandardToSPIRV`, respectively.
There are also common utilities when targeting SPIR-V from any dialect:
diff --git a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h b/mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h
similarity index 73%
rename from mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h
rename to mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h
index 8bdb228c9ccc..ad5dac003897 100644
--- a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h
+++ b/mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h
@@ -1,4 +1,4 @@
-//===- ConvertGPUToSPIRV.h - GPU Ops to SPIR-V dialect patterns ----C++ -*-===//
+//===- GPUToSPIRV.h - GPU to SPIR-V Patterns --------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides patterns for lowering GPU Ops to SPIR-V dialect.
+// Provides patterns to convert GPU dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
-#define MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
+#ifndef MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
+#define MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
#include "mlir/Transforms/DialectConversion.h"
@@ -26,4 +26,4 @@ void populateGPUToSPIRVPatterns(MLIRContext *context,
OwningRewritePatternList &patterns);
} // namespace mlir
-#endif // MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
+#endif // MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
diff --git a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h b/mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h
similarity index 52%
rename from mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h
rename to mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h
index f22db8477d84..dba8d274c7a9 100644
--- a/mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h
@@ -1,4 +1,4 @@
-//===- ConvertGPUToSPIRVPass.h - GPU to SPIR-V conversion pass --*- C++ -*-===//
+//===- GPUToSPIRVPass.h - GPU to SPIR-V Passes ------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,25 +6,24 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides a pass to convert GPU ops to SPIRV ops.
+// Provides passes to convert GPU dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRVPASS_H
-#define MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRVPASS_H
-
-#include "mlir/Support/LLVM.h"
+#ifndef MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
+#define MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
#include <memory>
namespace mlir {
class ModuleOp;
-template <typename T> class OperationPass;
+template <typename T>
+class OperationPass;
-/// Pass to convert GPU Ops to SPIR-V ops. For a gpu.func to be converted, it
-/// should have a spv.entry_point_abi attribute.
+/// Creates a pass to convert GPU Ops to SPIR-V ops. For a gpu.func to be
+/// converted, it should have a spv.entry_point_abi attribute.
std::unique_ptr<OperationPass<ModuleOp>> createConvertGPUToSPIRVPass();
} // namespace mlir
-#endif // MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRVPASS_H
+#endif // MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h
index a37048ad258d..b2fc9e4e9138 100644
--- a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h
+++ b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h
@@ -1,4 +1,4 @@
-//===- LinalgToSPIRV.h - Linalg to SPIR-V dialect conversion ----*- C++ -*-===//
+//===- LinalgToSPIRV.h - Linalg to SPIR-V Patterns --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file provides patterns for Linalg to SPIR-V dialect conversion.
+// Provides patterns to convert Linalg dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
diff --git a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h
index 9b10b4b705d5..b758b87c80af 100644
--- a/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h
@@ -1,4 +1,4 @@
-//===- LinalgToSPIRVPass.h - Linalg to SPIR-V conversion pass --*- C++ -*-===//
+//===- LinalgToSPIRVPass.h - Linalg to SPIR-V Passes -----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file provides a pass for Linalg to SPIR-V dialect conversion.
+// Provides passes to convert Linalg dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
diff --git a/mlir/include/mlir/Conversion/Passes.h b/mlir/include/mlir/Conversion/Passes.h
index 21b35804ab36..64b99d33ab61 100644
--- a/mlir/include/mlir/Conversion/Passes.h
+++ b/mlir/include/mlir/Conversion/Passes.h
@@ -14,7 +14,7 @@
#include "mlir/Conversion/GPUCommon/GPUCommonPass.h"
#include "mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h"
#include "mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"
-#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h"
+#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
#include "mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"
#include "mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h"
#include "mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h"
@@ -25,14 +25,14 @@
#include "mlir/Conversion/SCFToOpenMP/SCFToOpenMP.h"
#include "mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h"
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
#include "mlir/Conversion/ShapeToStandard/ShapeToStandard.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h"
#include "mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h"
#include "mlir/Conversion/VectorToROCDL/VectorToROCDL.h"
#include "mlir/Conversion/VectorToSCF/VectorToSCF.h"
-#include "mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h"
+#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h"
namespace mlir {
diff --git a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h
index 59fa0082e0cf..e0bab2759753 100644
--- a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h
+++ b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h
@@ -1,4 +1,4 @@
-//===------------ SCFToSPIRV.h - Pass entrypoint ----------------*- C++ -*-===//
+//===- SCFToSPIRV.h - SCF to SPIR-V Patterns --------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides patterns for lowering SCF ops to SPIR-V dialect.
+// Provides patterns to convert SCF dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
#ifndef MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRV_H_
diff --git a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h
index 94705d2200c4..5e35d6267086 100644
--- a/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h
@@ -1,10 +1,14 @@
-//===- SCFToSPIRVPass.h - SCF to SPIR-V Conversion Pass ---------*- C++ -*-===//
+//===- SCFToSPIRVPass.h - SCF to SPIR-V Passes ------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
+//
+// Provides passes to convert SCF dialect to SPIR-V dialect.
+//
+//===----------------------------------------------------------------------===//
#ifndef MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRVPASS_H
#define MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h b/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h
similarity index 89%
rename from mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h
rename to mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h
index dd9fb68fa80b..3ba24eaac1a0 100644
--- a/mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h
+++ b/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h
@@ -1,4 +1,4 @@
-//===- ConvertSPIRVToLLVM.h - Convert SPIR-V to LLVM dialect ----*- C++ -*-===//
+//===- SPIRVToLLVM.h - SPIR-V to LLVM Patterns ------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVM_H
-#define MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVM_H
+#ifndef MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVM_H
+#define MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVM_H
#include "mlir/Transforms/DialectConversion.h"
@@ -57,4 +57,4 @@ void populateSPIRVToLLVMModuleConversionPatterns(
} // namespace mlir
-#endif // MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVM_H
+#endif // MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVM_H
diff --git a/mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h b/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h
similarity index 78%
rename from mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h
rename to mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h
index 9525a1eac984..bc70736c7d3b 100644
--- a/mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h
+++ b/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h
@@ -1,4 +1,4 @@
-//===- ConvertSPIRVToLLVMPass.h - SPIR-V dialect to LLVM pass ---*- C++ -*-===//
+//===- SPIRVToLLVMPass.h - SPIR-V to LLVM Passes ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides a pass to lower from SPIR-V dialect to LLVM dialect.
+// Provides passes to convert SPIR-V dialect to LLVM dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVMPASS_H
-#define MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVMPASS_H
+#ifndef MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVMPASS_H
+#define MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVMPASS_H
#include <memory>
@@ -35,4 +35,4 @@ std::unique_ptr<OperationPass<ModuleOp>> createConvertSPIRVToLLVMPass();
} // namespace mlir
-#endif // MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVMPASS_H_
+#endif // MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVMPASS_H
diff --git a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h b/mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h
similarity index 68%
rename from mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h
rename to mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h
index 6e19358e2f4e..6cea1999f368 100644
--- a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h
+++ b/mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h
@@ -1,4 +1,4 @@
-//===- ConvertStandardToSPIRV.h - Convert to SPIR-V dialect -----*- C++ -*-===//
+//===- StandardToSPIRV.h - Standard to SPIR-V Patterns --------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,21 +6,21 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides patterns to lower StandardOps to SPIR-V dialect.
+// Provides patterns to convert Standard dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRV_H
-#define MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRV_H
+#ifndef MLIR_CONVERSION_STANDARDTOSPIRV_STANDARDTOSPIRV_H
+#define MLIR_CONVERSION_STANDARDTOSPIRV_STANDARDTOSPIRV_H
#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
class SPIRVTypeConverter;
-/// Appends to a pattern list additional patterns for translating StandardOps to
-/// SPIR-V ops. Also adds the patterns legalize ops not directly translated to
-/// SPIR-V dialect.
+/// Appends to a pattern list additional patterns for translating standard ops
+/// to SPIR-V ops. Also adds the patterns to legalize ops not directly
+/// translated to SPIR-V dialect.
void populateStandardToSPIRVPatterns(MLIRContext *context,
SPIRVTypeConverter &typeConverter,
OwningRewritePatternList &patterns);
@@ -32,4 +32,4 @@ void populateStdLegalizationPatternsForSPIRVLowering(
} // namespace mlir
-#endif // MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRV_H
+#endif // MLIR_CONVERSION_STANDARDTOSPIRV_STANDARDTOSPIRV_H
diff --git a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h b/mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h
similarity index 57%
rename from mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h
rename to mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h
index 29e1d635a00f..e987527e56f5 100644
--- a/mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h
@@ -1,4 +1,4 @@
-//===- ConvertStandardToSPIRVPass.h - StdOps to SPIR-V pass -----*- C++ -*-===//
+//===- StandardToSPIRVPass.h - Standard to SPIR-V Passes --------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,23 +6,23 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides a pass to lower from StandardOps to SPIR-V dialect.
+// Provides passes to convert Standard dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRVPASS_H
-#define MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRVPASS_H
+#ifndef MLIR_CONVERSION_STANDARDTOSPIRV_STANDARDTOSPIRVPASS_H
+#define MLIR_CONVERSION_STANDARDTOSPIRV_STANDARDTOSPIRVPASS_H
#include "mlir/Pass/Pass.h"
namespace mlir {
-/// Pass to convert StandardOps to SPIR-V ops.
+/// Creates a pass to convert standard ops to SPIR-V ops.
std::unique_ptr<OperationPass<ModuleOp>> createConvertStandardToSPIRVPass();
-/// Pass to legalize ops that are not directly lowered to SPIR-V.
+/// Creates a pass to legalize ops that are not directly lowered to SPIR-V.
std::unique_ptr<Pass> createLegalizeStdOpsForSPIRVLoweringPass();
} // namespace mlir
-#endif // MLIR_CONVERSION_STANDARDTOSPIRV_CONVERTSTANDARDTOSPIRVPASS_H
+#endif // MLIR_CONVERSION_STANDARDTOSPIRV_STANDARDTOSPIRVPASS_H
diff --git a/mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRV.h b/mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h
similarity index 67%
rename from mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRV.h
rename to mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h
index de664df83e83..7908f6ed3b6f 100644
--- a/mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRV.h
+++ b/mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h
@@ -1,4 +1,4 @@
-//=- ConvertVectorToSPIRV.h - Vector Ops to SPIR-V dialect patterns - C++ -*-=//
+//=- VectorToSPIRV.h - Vector to SPIR-V Patterns ------------------*- C++ -*-=//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides patterns for lowering Vector Ops to SPIR-V dialect.
+// Provides patterns to convert Vector dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_INCLUDE_MLIR_CONVERSION_VECTORTOSPIRV_CONVERTVECTORTOSPIRV_H_
-#define MLIR_INCLUDE_MLIR_CONVERSION_VECTORTOSPIRV_CONVERTVECTORTOSPIRV_H_
+#ifndef MLIR_INCLUDE_MLIR_CONVERSION_VECTORTOSPIRV_VECTORTOSPIRV_H
+#define MLIR_INCLUDE_MLIR_CONVERSION_VECTORTOSPIRV_VECTORTOSPIRV_H
#include "mlir/Transforms/DialectConversion.h"
@@ -26,4 +26,4 @@ void populateVectorToSPIRVPatterns(MLIRContext *context,
} // namespace mlir
-#endif // MLIR_INCLUDE_MLIR_CONVERSION_VECTORTOSPIRV_CONVERTVECTORTOSPIRV_H_
+#endif // MLIR_INCLUDE_MLIR_CONVERSION_VECTORTOSPIRV_VECTORTOSPIRV_H
diff --git a/mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h b/mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h
similarity index 58%
rename from mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h
rename to mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h
index 7d4c7c1fb025..3a9d0a17d025 100644
--- a/mlir/include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h
+++ b/mlir/include/mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h
@@ -1,4 +1,4 @@
-//=- ConvertVectorToSPIRVPass.h - Pass converting Vector to SPIRV -*- C++ -*-=//
+//=- VectorToSPIRVPass.h - Vector to SPIR-V Passes ----------------*- C++ -*-=//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,20 +6,20 @@
//
//===----------------------------------------------------------------------===//
//
-// Provides a pass to convert Vector ops to SPIR-V ops.
+// Provides passes to convert Vector dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CONVERSION_VECTORTOSPIRV_CONVERTGPUTOSPIRVPASS_H
-#define MLIR_CONVERSION_VECTORTOSPIRV_CONVERTGPUTOSPIRVPASS_H
+#ifndef MLIR_CONVERSION_VECTORTOSPIRV_GPUTOSPIRVPASS_H
+#define MLIR_CONVERSION_VECTORTOSPIRV_GPUTOSPIRVPASS_H
#include "mlir/Pass/Pass.h"
namespace mlir {
-/// Pass to convert Vector Ops to SPIR-V ops.
+/// Creates a pass to convert Vector Ops to SPIR-V ops.
std::unique_ptr<OperationPass<ModuleOp>> createConvertVectorToSPIRVPass();
} // namespace mlir
-#endif // MLIR_CONVERSION_VECTORTOSPIRV_CONVERTGPUTOSPIRVPASS_H
+#endif // MLIR_CONVERSION_VECTORTOSPIRV_GPUTOSPIRVPASS_H
diff --git a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
index fba29cf5f342..01fa3e144843 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
@@ -2,9 +2,9 @@ set(LLVM_TARGET_DEFINITIONS GPUToSPIRV.td)
mlir_tablegen(GPUToSPIRV.cpp.inc -gen-rewriters)
add_public_tablegen_target(MLIRGPUToSPIRVIncGen)
-add_mlir_conversion_library(MLIRGPUToSPIRVTransforms
- ConvertGPUToSPIRV.cpp
- ConvertGPUToSPIRVPass.cpp
+add_mlir_conversion_library(MLIRGPUToSPIRV
+ GPUToSPIRV.cpp
+ GPUToSPIRVPass.cpp
DEPENDS
MLIRConversionPassIncGen
@@ -18,7 +18,7 @@ add_mlir_conversion_library(MLIRGPUToSPIRVTransforms
MLIRSPIRV
MLIRSPIRVConversion
MLIRStandard
- MLIRStandardToSPIRVTransforms
+ MLIRStandardToSPIRV
MLIRSupport
MLIRTransforms
)
diff --git a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
similarity index 98%
rename from mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
rename to mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index 259acd7a9ce7..e84269e9418d 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -1,4 +1,4 @@
-//===- ConvertGPUToSPIRV.cpp - Convert GPU ops to SPIR-V dialect ----------===//
+//===- GPUToSPIRV.cpp - GPU to SPIR-V Patterns ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements the conversion patterns from GPU ops to SPIR-V dialect.
+// This file implements patterns to convert GPU dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h"
+
+#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h"
#include "mlir/Dialect/GPU/GPUDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
diff --git a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
similarity index 89%
rename from mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
rename to mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
index 2c2a47fcc5ed..8edb42e9a0f6 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
@@ -1,4 +1,4 @@
-//===- ConvertGPUToSPIRVPass.cpp - GPU to SPIR-V dialect lowering passes --===//
+//===- GPUToSPIRVPass.cpp - GPU to SPIR-V Passes --------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -7,15 +7,15 @@
//===----------------------------------------------------------------------===//
//
// This file implements a pass to convert a kernel function in the GPU Dialect
-// into a spv.module operation
+// into a spv.module operation.
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h"
+#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
#include "../PassDetail.h"
-#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h"
+#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h"
#include "mlir/Dialect/GPU/GPUDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
diff --git a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
index a40abba0351f..27f7febd7006 100644
--- a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_mlir_conversion_library(MLIRLinalgToSPIRVTransforms
+add_mlir_conversion_library(MLIRLinalgToSPIRV
LinalgToSPIRV.cpp
LinalgToSPIRVPass.cpp
diff --git a/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp b/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
index 0e09d9596a62..8133a37aa7ad 100644
--- a/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
+++ b/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRV.cpp
@@ -1,4 +1,4 @@
-//===- LinalgToSPIRV.cpp - Linalg to SPIR-V dialect conversion ------------===//
+//===- LinalgToSPIRV.cpp - Linalg to SPIR-V Patterns ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.cpp b/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.cpp
index 1ce2f41f46b8..ddcc97d359ca 100644
--- a/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.cpp
+++ b/mlir/lib/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.cpp
@@ -1,4 +1,4 @@
-//===- LinalgToSPIRVPass.cpp - Linalg to SPIR-V conversion pass -----------===//
+//===- LinalgToSPIRVPass.cpp - Linalg to SPIR-V Passes --------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt
index d9400716a0b2..5361fc742431 100644
--- a/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/SCFToSPIRV/CMakeLists.txt
@@ -11,7 +11,7 @@ add_mlir_conversion_library(MLIRSCFToSPIRV
LINK_LIBS PUBLIC
MLIRSPIRV
MLIRSPIRVConversion
- MLIRStandardToSPIRVTransforms
+ MLIRStandardToSPIRV
MLIRIR
MLIRPass
MLIRStandard
diff --git a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
index 576f38fba819..da2488db1182 100644
--- a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
+++ b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
@@ -1,4 +1,4 @@
-//===- SCFToSPIRV.cpp - Convert SCF ops to SPIR-V dialect -----------------===//
+//===- SCFToSPIRV.cpp - SCF to SPIR-V Patterns ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,9 +6,10 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements the conversion patterns from SCF ops to SPIR-V dialect.
+// This file implements patterns to convert SCF dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
+
#include "mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
diff --git a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp
index 5c74cc3397be..b0d879974a56 100644
--- a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp
+++ b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp
@@ -1,4 +1,4 @@
-//===- SCFToSPIRVPass.cpp - SCF to SPIR-V Dialect Conversion Pass ---------===//
+//===- SCFToSPIRVPass.cpp - SCF to SPIR-V Passes --------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -14,7 +14,7 @@
#include "../PassDetail.h"
#include "mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/CMakeLists.txt b/mlir/lib/Conversion/SPIRVToLLVM/CMakeLists.txt
index 8d3cbc6c7c33..f57e42cff29e 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/SPIRVToLLVM/CMakeLists.txt
@@ -1,7 +1,7 @@
add_mlir_conversion_library(MLIRSPIRVToLLVM
ConvertLaunchFuncToLLVMCalls.cpp
- ConvertSPIRVToLLVM.cpp
- ConvertSPIRVToLLVMPass.cpp
+ SPIRVToLLVM.cpp
+ SPIRVToLLVMPass.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/SPIRVToLLVM
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
index 3b4a8d66001d..c293dacf8ec5 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
@@ -12,8 +12,8 @@
//===----------------------------------------------------------------------===//
#include "../PassDetail.h"
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h"
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
#include "mlir/Dialect/GPU/GPUDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
similarity index 99%
rename from mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
rename to mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
index 2633f4bdfe6f..76a4e0b2e07e 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
@@ -1,4 +1,4 @@
-//===- ConvertSPIRVToLLVM.cpp - SPIR-V dialect to LLVM dialect conversion -===//
+//===- SPIRVToLLVM.cpp - SPIR-V to LLVM Patterns --------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
@@ -894,7 +894,7 @@ class LoadStorePattern : public SPIRVToLLVMConversion<SPIRVop> {
if (!op.memory_access().hasValue()) {
replaceWithLoadOrStore(op, rewriter, this->typeConverter, /*alignment=*/0,
- /*isVolatile=*/false, /*isNonTemporal=*/ false);
+ /*isVolatile=*/false, /*isNonTemporal=*/false);
return success();
}
auto memoryAccess = op.memory_access().getValue();
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.cpp b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.cpp
similarity index 91%
rename from mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.cpp
rename to mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.cpp
index b93ce48cb804..2a4113f307fa 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.cpp
@@ -1,4 +1,4 @@
-//===- ConvertSPIRVToLLVMPass.cpp - Convert SPIR-V ops to LLVM ops --------===//
+//===- SPIRVToLLVMPass.cpp - SPIR-V to LLVM Passes ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,9 +10,9 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
#include "../PassDetail.h"
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
diff --git a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
index 4af5d7d4f83a..7c5d62ff4c19 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
@@ -1,7 +1,7 @@
-add_mlir_conversion_library(MLIRStandardToSPIRVTransforms
- ConvertStandardToSPIRV.cpp
- ConvertStandardToSPIRVPass.cpp
+add_mlir_conversion_library(MLIRStandardToSPIRV
LegalizeStandardForSPIRV.cpp
+ StandardToSPIRV.cpp
+ StandardToSPIRVPass.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
diff --git a/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp b/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
index 10d727df701b..96fdcb593c04 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
+++ b/mlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
@@ -12,8 +12,8 @@
//===----------------------------------------------------------------------===//
#include "../PassDetail.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Vector/VectorOps.h"
diff --git a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp
similarity index 99%
rename from mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
rename to mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp
index 470f4143f2c5..164ed36095ac 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
+++ b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp
@@ -1,4 +1,4 @@
-//===- ConvertStandardToSPIRV.cpp - Standard to SPIR-V dialect conversion--===//
+//===- StandardToSPIRV.cpp - Standard to SPIR-V Patterns ------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements patterns to convert standard ops to SPIR-V ops.
+// This file implements patterns to convert standard dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRVPass.cpp
similarity index 83%
rename from mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
rename to mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRVPass.cpp
index c2477e852307..8ae67cc6a16a 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
+++ b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRVPass.cpp
@@ -1,4 +1,4 @@
-//===- ConvertStandardToSPIRVPass.cpp - Convert Std Ops to SPIR-V Ops -----===//
+//===- StandardToSPIRVPass.cpp - Standard to SPIR-V Passes ----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,13 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements a pass to convert MLIR standard ops into the SPIR-V
-// ops.
+// This file implements a pass to convert standard dialect to SPIR-V dialect.
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h"
#include "../PassDetail.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRV.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
diff --git a/mlir/lib/Conversion/VectorToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/VectorToSPIRV/CMakeLists.txt
index 060afdfbbddb..76518839531c 100644
--- a/mlir/lib/Conversion/VectorToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/VectorToSPIRV/CMakeLists.txt
@@ -1,5 +1,6 @@
add_mlir_conversion_library(MLIRVectorToSPIRV
VectorToSPIRV.cpp
+ VectorToSPIRVPass.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToSPIRV
diff --git a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
index 7f7339190115..a2735e646bec 100644
--- a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
+++ b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp
@@ -1,4 +1,4 @@
-//===------- VectorToSPIRV.cpp - Vector to SPIRV lowering passes ----------===//
+//===- VectorToSPIRV.cpp - Vector to SPIR-V Patterns ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,20 +6,18 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements a pass to generate SPIRV operations for Vector
-// operations.
+// This file implements patterns to convert Vector dialect to SPIRV dialect.
//
//===----------------------------------------------------------------------===//
+#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h"
+
#include "../PassDetail.h"
-#include "mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRV.h"
-#include "mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
#include "mlir/Dialect/Vector/VectorOps.h"
-#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
using namespace mlir;
@@ -68,7 +66,7 @@ struct VectorInsertOpConvert final : public SPIRVOpLowering<vector::InsertOp> {
matchAndRewrite(vector::InsertOp insertOp, ArrayRef<Value> operands,
ConversionPatternRewriter &rewriter) const override {
if (insertOp.getSourceType().isa<VectorType>() ||
- !spirv::CompositeType::isValid(insertOp.getDestVectorType()))
+ !spirv::CompositeType::isValid(insertOp.getDestVectorType()))
return failure();
vector::InsertOp::Adaptor adaptor(operands);
int32_t id = insertOp.position().begin()->cast<IntegerAttr>().getInt();
@@ -124,34 +122,3 @@ void mlir::populateVectorToSPIRVPatterns(MLIRContext *context,
VectorInsertOpConvert, VectorExtractElementOpConvert,
VectorInsertElementOpConvert>(context, typeConverter);
}
-
-namespace {
-struct LowerVectorToSPIRVPass
- : public ConvertVectorToSPIRVBase<LowerVectorToSPIRVPass> {
- void runOnOperation() override;
-};
-} // namespace
-
-void LowerVectorToSPIRVPass::runOnOperation() {
- MLIRContext *context = &getContext();
- ModuleOp module = getOperation();
-
- auto targetAttr = spirv::lookupTargetEnvOrDefault(module);
- std::unique_ptr<ConversionTarget> target =
- spirv::SPIRVConversionTarget::get(targetAttr);
-
- SPIRVTypeConverter typeConverter(targetAttr);
- OwningRewritePatternList patterns;
- populateVectorToSPIRVPatterns(context, typeConverter, patterns);
-
- target->addLegalOp<ModuleOp, ModuleTerminatorOp>();
- target->addLegalOp<FuncOp>();
-
- if (failed(applyFullConversion(module, *target, std::move(patterns))))
- return signalPassFailure();
-}
-
-std::unique_ptr<OperationPass<ModuleOp>>
-mlir::createConvertVectorToSPIRVPass() {
- return std::make_unique<LowerVectorToSPIRVPass>();
-}
diff --git a/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRVPass.cpp b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRVPass.cpp
new file mode 100644
index 000000000000..9a4d09f9ad0e
--- /dev/null
+++ b/mlir/lib/Conversion/VectorToSPIRV/VectorToSPIRVPass.cpp
@@ -0,0 +1,53 @@
+//===- VectorToSPIRVPass.cpp - Vector to SPIR-V Passes --------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements a pass to convert Vector dialect to SPIRV dialect.
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h"
+
+#include "../PassDetail.h"
+#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h"
+#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
+#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
+#include "mlir/Pass/Pass.h"
+#include "mlir/Transforms/DialectConversion.h"
+
+using namespace mlir;
+
+namespace {
+struct LowerVectorToSPIRVPass
+ : public ConvertVectorToSPIRVBase<LowerVectorToSPIRVPass> {
+ void runOnOperation() override;
+};
+} // namespace
+
+void LowerVectorToSPIRVPass::runOnOperation() {
+ MLIRContext *context = &getContext();
+ ModuleOp module = getOperation();
+
+ auto targetAttr = spirv::lookupTargetEnvOrDefault(module);
+ std::unique_ptr<ConversionTarget> target =
+ spirv::SPIRVConversionTarget::get(targetAttr);
+
+ SPIRVTypeConverter typeConverter(targetAttr);
+ OwningRewritePatternList patterns;
+ populateVectorToSPIRVPatterns(context, typeConverter, patterns);
+
+ target->addLegalOp<ModuleOp, ModuleTerminatorOp>();
+ target->addLegalOp<FuncOp>();
+
+ if (failed(applyFullConversion(module, *target, std::move(patterns))))
+ return signalPassFailure();
+}
+
+std::unique_ptr<OperationPass<ModuleOp>>
+mlir::createConvertVectorToSPIRVPass() {
+ return std::make_unique<LowerVectorToSPIRVPass>();
+}
diff --git a/mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp b/mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp
index 31dbae336218..1684361ffc3f 100644
--- a/mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp
+++ b/mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp
@@ -12,8 +12,8 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h"
-#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h"
+#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
+#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
#include "mlir/Dialect/GPU/Passes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
diff --git a/mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp b/mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp
index 98d3bcff02cf..936b1d314e84 100644
--- a/mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp
+++ b/mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp
@@ -12,10 +12,10 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h"
+#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
#include "mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
-#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h"
+#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h"
#include "mlir/Dialect/GPU/Passes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/Transforms/Passes.h"
More information about the llvm-branch-commits
mailing list