Skip to content

Commit 930c74f

Browse files
committed
[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
1 parent 34e70d7 commit 930c74f

36 files changed

+171
-146
lines changed

mlir/docs/Dialects/SPIR-V.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ in a few places:
11451145
are at [lib/Conversion/StandardToSPIRV][MlirStdToSpirvLibs].
11461146

11471147
These dialect to dialect conversions have their dedicated libraries,
1148-
`MLIRGPUToSPIRVTransforms` and `MLIRStandardToSPIRVTransforms`, respectively.
1148+
`MLIRGPUToSPIRV` and `MLIRStandardToSPIRV`, respectively.
11491149

11501150
There are also common utilities when targeting SPIR-V from any dialect:
11511151

mlir/include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h renamed to mlir/include/mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//===- ConvertGPUToSPIRV.h - GPU Ops to SPIR-V dialect patterns ----C++ -*-===//
1+
//===- GPUToSPIRV.h - GPU to SPIR-V Patterns --------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// Provides patterns for lowering GPU Ops to SPIR-V dialect.
9+
// Provides patterns to convert GPU dialect to SPIR-V dialect.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
14-
#define MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
13+
#ifndef MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
14+
#define MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
1515

1616
#include "mlir/Transforms/DialectConversion.h"
1717

@@ -26,4 +26,4 @@ void populateGPUToSPIRVPatterns(MLIRContext *context,
2626
OwningRewritePatternList &patterns);
2727
} // namespace mlir
2828

29-
#endif // MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRV_H
29+
#endif // MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRV_H
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
//===- ConvertGPUToSPIRVPass.h - GPU to SPIR-V conversion pass --*- C++ -*-===//
1+
//===- GPUToSPIRVPass.h - GPU to SPIR-V Passes ------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// Provides a pass to convert GPU ops to SPIRV ops.
9+
// Provides passes to convert GPU dialect to SPIR-V dialect.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRVPASS_H
14-
#define MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRVPASS_H
15-
16-
#include "mlir/Support/LLVM.h"
13+
#ifndef MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
14+
#define MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H
1715

1816
#include <memory>
1917

2018
namespace mlir {
2119

2220
class ModuleOp;
23-
template <typename T> class OperationPass;
21+
template <typename T>
22+
class OperationPass;
2423

25-
/// Pass to convert GPU Ops to SPIR-V ops. For a gpu.func to be converted, it
26-
/// should have a spv.entry_point_abi attribute.
24+
/// Creates a pass to convert GPU Ops to SPIR-V ops. For a gpu.func to be
25+
/// converted, it should have a spv.entry_point_abi attribute.
2726
std::unique_ptr<OperationPass<ModuleOp>> createConvertGPUToSPIRVPass();
2827

2928
} // namespace mlir
30-
#endif // MLIR_CONVERSION_GPUTOSPIRV_CONVERTGPUTOSPIRVPASS_H
29+
#endif // MLIR_CONVERSION_GPUTOSPIRV_GPUTOSPIRVPASS_H

mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRV.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===- LinalgToSPIRV.h - Linalg to SPIR-V dialect conversion ----*- C++ -*-===//
1+
//===- LinalgToSPIRV.h - Linalg to SPIR-V Patterns --------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file provides patterns for Linalg to SPIR-V dialect conversion.
9+
// Provides patterns to convert Linalg dialect to SPIR-V dialect.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

mlir/include/mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===- LinalgToSPIRVPass.h - Linalg to SPIR-V conversion pass --*- C++ -*-===//
1+
//===- LinalgToSPIRVPass.h - Linalg to SPIR-V Passes -----------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// This file provides a pass for Linalg to SPIR-V dialect conversion.
9+
// Provides passes to convert Linalg dialect to SPIR-V dialect.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

mlir/include/mlir/Conversion/Passes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "mlir/Conversion/GPUCommon/GPUCommonPass.h"
1515
#include "mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h"
1616
#include "mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"
17-
#include "mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h"
17+
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
1818
#include "mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"
1919
#include "mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h"
2020
#include "mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h"
@@ -25,14 +25,14 @@
2525
#include "mlir/Conversion/SCFToOpenMP/SCFToOpenMP.h"
2626
#include "mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h"
2727
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
28-
#include "mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h"
28+
#include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
2929
#include "mlir/Conversion/ShapeToStandard/ShapeToStandard.h"
3030
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
31-
#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h"
31+
#include "mlir/Conversion/StandardToSPIRV/StandardToSPIRVPass.h"
3232
#include "mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h"
3333
#include "mlir/Conversion/VectorToROCDL/VectorToROCDL.h"
3434
#include "mlir/Conversion/VectorToSCF/VectorToSCF.h"
35-
#include "mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h"
35+
#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h"
3636

3737
namespace mlir {
3838

mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===------------ SCFToSPIRV.h - Pass entrypoint ----------------*- C++ -*-===//
1+
//===- SCFToSPIRV.h - SCF to SPIR-V Patterns --------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// Provides patterns for lowering SCF ops to SPIR-V dialect.
9+
// Provides patterns to convert SCF dialect to SPIR-V dialect.
1010
//
1111
//===----------------------------------------------------------------------===//
1212
#ifndef MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRV_H_

mlir/include/mlir/Conversion/SCFToSPIRV/SCFToSPIRVPass.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
//===- SCFToSPIRVPass.h - SCF to SPIR-V Conversion Pass ---------*- C++ -*-===//
1+
//===- SCFToSPIRVPass.h - SCF to SPIR-V Passes ------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8+
//
9+
// Provides passes to convert SCF dialect to SPIR-V dialect.
10+
//
11+
//===----------------------------------------------------------------------===//
812

913
#ifndef MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRVPASS_H
1014
#define MLIR_CONVERSION_SCFTOSPIRV_SCFTOSPIRVPASS_H

mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h renamed to mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- ConvertSPIRVToLLVM.h - Convert SPIR-V to LLVM dialect ----*- C++ -*-===//
1+
//===- SPIRVToLLVM.h - SPIR-V to LLVM Patterns ------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVM_H
14-
#define MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVM_H
13+
#ifndef MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVM_H
14+
#define MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVM_H
1515

1616
#include "mlir/Transforms/DialectConversion.h"
1717

@@ -57,4 +57,4 @@ void populateSPIRVToLLVMModuleConversionPatterns(
5757

5858
} // namespace mlir
5959

60-
#endif // MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVM_H
60+
#endif // MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVM_H

mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.h renamed to mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//===- ConvertSPIRVToLLVMPass.h - SPIR-V dialect to LLVM pass ---*- C++ -*-===//
1+
//===- SPIRVToLLVMPass.h - SPIR-V to LLVM Passes ----------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// Provides a pass to lower from SPIR-V dialect to LLVM dialect.
9+
// Provides passes to convert SPIR-V dialect to LLVM dialect.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVMPASS_H
14-
#define MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVMPASS_H
13+
#ifndef MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVMPASS_H
14+
#define MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVMPASS_H
1515

1616
#include <memory>
1717

@@ -35,4 +35,4 @@ std::unique_ptr<OperationPass<ModuleOp>> createConvertSPIRVToLLVMPass();
3535

3636
} // namespace mlir
3737

38-
#endif // MLIR_CONVERSION_SPIRVTOLLVM_CONVERTSPIRVTOLLVMPASS_H_
38+
#endif // MLIR_CONVERSION_SPIRVTOLLVM_SPIRVTOLLVMPASS_H

0 commit comments

Comments
 (0)