Skip to content

Commit 4ead2cf

Browse files
committed
[mlir] Rename conversions involving ex-Loop dialect to mention SCF
The following Conversions are affected: LoopToStandard -> SCFToStandard, LoopsToGPU -> SCFToGPU, VectorToLoops -> VectorToSCF. Full file paths are affected. Additionally, drop the 'Convert' prefix from filenames living under lib/Conversion where applicable. API names and CLI options for pass testing are also renamed when applicable. In particular, LoopsToGPU contains several passes that apply to different kinds of loops (`for` or `parallel`), for which the original names are preserved. Differential Revision: https://reviews.llvm.org/D79940
1 parent 56970ec commit 4ead2cf

35 files changed

+94
-95
lines changed

flang/tools/tco/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(LIBS
1111
MLIRTransforms
1212
MLIRAffineToStandard
1313
MLIRAnalysis
14-
MLIRLoopToStandard
14+
MLIRSCFToStandard
1515
MLIREDSC
1616
MLIRParser
1717
MLIRStandardToLLVM

mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "toy/Passes.h"
1717

1818
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
19-
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
19+
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
2020
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
2121
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
2222
#include "mlir/Dialect/Affine/IR/AffineOps.h"

mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "toy/Passes.h"
1717

1818
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
19-
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
19+
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
2020
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
2121
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
2222
#include "mlir/Dialect/Affine/IR/AffineOps.h"

mlir/include/mlir/Conversion/Passes.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,22 @@ def ConvertLinalgToSPIRV : Pass<"convert-linalg-to-spirv", "ModuleOp"> {
161161
}
162162

163163
//===----------------------------------------------------------------------===//
164-
// LoopToStandard
164+
// SCFToStandard
165165
//===----------------------------------------------------------------------===//
166166

167-
def ConvertLoopToStandard : Pass<"convert-loop-to-std"> {
167+
def SCFToStandard : Pass<"convert-scf-to-std"> {
168168
let summary = "Convert SCF dialect to Standard dialect, replacing structured"
169169
" control flow with a CFG";
170170
let constructor = "mlir::createLowerToCFGPass()";
171171
}
172172

173173
//===----------------------------------------------------------------------===//
174-
// LoopsToGPU
174+
// SCFToGPU
175175
//===----------------------------------------------------------------------===//
176176

177-
def ConvertSimpleLoopsToGPU : FunctionPass<"convert-loops-to-gpu"> {
177+
def ConvertSimpleSCFToGPU : FunctionPass<"convert-scf-to-gpu"> {
178178
let summary = "Convert top-level loops to GPU kernels";
179-
let constructor = "mlir::createSimpleLoopsToGPUPass()";
179+
let constructor = "mlir::createSimpleSCFToGPUPass()";
180180
let options = [
181181
Option<"numBlockDims", "gpu-block-dims", "unsigned", /*default=*/"1u",
182182
"Number of GPU block dimensions for mapping">,
@@ -185,7 +185,7 @@ def ConvertSimpleLoopsToGPU : FunctionPass<"convert-loops-to-gpu"> {
185185
];
186186
}
187187

188-
def ConvertLoopsToGPU : FunctionPass<"convert-loop-op-to-gpu"> {
188+
def ConvertSCFToGPU : FunctionPass<"convert-loop-op-to-gpu"> {
189189
let summary = "Convert top-level scf::ForOp to GPU kernels";
190190
let constructor = "mlir::createLoopToGPUPass()";
191191
let options = [

mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPU.h renamed to mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===- LoopsToGPU.h - Convert loop nests to GPU kernels ---------*- C++ -*-===//
1+
//===- SCFToGPU.h - Convert loop nests to GPU kernels -----------*- 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-
#ifndef MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPU_H_
9-
#define MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPU_H_
8+
#ifndef MLIR_CONVERSION_SCFTOGPU_SCFTOGPU_H_
9+
#define MLIR_CONVERSION_SCFTOGPU_SCFTOGPU_H_
1010

1111
#include "mlir/Support/LLVM.h"
1212

@@ -81,4 +81,4 @@ void populateParallelLoopToGPUPatterns(OwningRewritePatternList &patterns,
8181

8282
} // namespace mlir
8383

84-
#endif // MLIR_CONVERSION_LOOPSTOGPU_LOOPSTOGPU_H_
84+
#endif // MLIR_CONVERSION_SCFTOGPU_SCFTOGPU_H_

mlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h renamed to mlir/include/mlir/Conversion/SCFToGPU/SCFToGPUPass.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- LoopsToGPUPass.h - Pass converting loops to GPU kernels --*- C++ -*-===//
1+
//===- SCFToGPUPass.h - Pass converting loops to GPU kernels ----*- 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.
@@ -14,7 +14,8 @@
1414

1515
namespace mlir {
1616
class FuncOp;
17-
template <typename T> class OperationPass;
17+
template <typename T>
18+
class OperationPass;
1819
class Pass;
1920

2021
/// Create a pass that converts loop nests into GPU kernels. It considers
@@ -26,8 +27,8 @@ class Pass;
2627
/// to strip-mine the loops and to perform the dependence analysis before
2728
/// calling the conversion.
2829
std::unique_ptr<OperationPass<FuncOp>>
29-
createSimpleLoopsToGPUPass(unsigned numBlockDims, unsigned numThreadDims);
30-
std::unique_ptr<OperationPass<FuncOp>> createSimpleLoopsToGPUPass();
30+
createSimpleSCFToGPUPass(unsigned numBlockDims, unsigned numThreadDims);
31+
std::unique_ptr<OperationPass<FuncOp>> createSimpleSCFToGPUPass();
3132

3233
/// Create a pass that converts every loop operation within the body of the
3334
/// FuncOp into a GPU launch. The number of workgroups and workgroup size for

mlir/include/mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h renamed to mlir/include/mlir/Conversion/SCFToStandard/SCFToStandard.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
//===- ConvertLoopToStandard.h - Pass entrypoint ----------------*- C++ -*-===//
1+
//===- ConvertSCFToStandard.h - Pass entrypoint -----------------*- 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-
#ifndef MLIR_CONVERSION_LOOPTOSTANDARD_CONVERTLOOPTOSTANDARD_H_
10-
#define MLIR_CONVERSION_LOOPTOSTANDARD_CONVERTLOOPTOSTANDARD_H_
9+
#ifndef MLIR_CONVERSION_SCFTOSTANDARD_SCFTOSTANDARD_H_
10+
#define MLIR_CONVERSION_SCFTOSTANDARD_SCFTOSTANDARD_H_
1111

1212
#include <memory>
1313
#include <vector>
@@ -32,4 +32,4 @@ std::unique_ptr<Pass> createLowerToCFGPass();
3232

3333
} // namespace mlir
3434

35-
#endif // MLIR_CONVERSION_LOOPTOSTANDARD_CONVERTLOOPTOSTANDARD_H_
35+
#endif // MLIR_CONVERSION_SCFTOSTANDARD_SCFTOSTANDARD_H_
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
//===- ConvertVectorToLoops.h - Utils to convert from the vector dialect --===//
1+
//===- VectorToSCF.h - Utils to convert from the vector dialect -*- 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-
#ifndef MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLOOPS_H_
10-
#define MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLOOPS_H_
9+
#ifndef MLIR_CONVERSION_VECTORTOSCF_VECTORTOSCF_H_
10+
#define MLIR_CONVERSION_VECTORTOSCF_VECTORTOSCF_H_
1111

1212
namespace mlir {
1313
class MLIRContext;
1414
class OwningRewritePatternList;
1515

1616
/// Collect a set of patterns to convert from the Vector dialect to loops + std.
17-
void populateVectorToLoopsConversionPatterns(OwningRewritePatternList &patterns,
18-
MLIRContext *context);
17+
void populateVectorToSCFConversionPatterns(OwningRewritePatternList &patterns,
18+
MLIRContext *context);
1919

2020
} // namespace mlir
2121

22-
#endif // MLIR_CONVERSION_VECTORTOLLVM_CONVERTVECTORTOLOOPS_H_
22+
#endif // MLIR_CONVERSION_VECTORTOSCF_VECTORTOSCF_H_

mlir/include/mlir/Dialect/GPU/ParallelLoopMapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ LogicalResult setMappingAttr(scf::ParallelOp ploopOp,
6363
/// encountered to the local workgroup. Within each mapping, the first three
6464
/// dimensions are mapped to x/y/z hardware ids and all following dimensions are
6565
/// mapped to sequential loops.
66-
void greedilyMapParallelLoopsToGPU(Region &region);
66+
void greedilyMapParallelSCFToGPU(Region &region);
6767

6868
} // end namespace mlir
6969
#endif // MLIR_DIALECT_GPU_PARALLELLOOPMAPPER_H

mlir/include/mlir/Dialect/Vector/VectorTransforms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MLIRContext;
1616
class OwningRewritePatternList;
1717

1818
/// Collect a set of patterns to convert from the Vector dialect to itself.
19-
/// Should be merged with populateVectorToLoopsLoweringPattern.
19+
/// Should be merged with populateVectorToSCFLoweringPattern.
2020
void populateVectorToVectorConversionPatterns(
2121
MLIRContext *context, OwningRewritePatternList &patterns,
2222
ArrayRef<int64_t> coarseVectorShape = {},

mlir/include/mlir/InitAllPasses.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include "mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h"
2424
#include "mlir/Conversion/LinalgToSPIRV/LinalgToSPIRVPass.h"
2525
#include "mlir/Conversion/LinalgToStandard/LinalgToStandard.h"
26-
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
27-
#include "mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h"
26+
#include "mlir/Conversion/SCFToGPU/SCFToGPUPass.h"
27+
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
2828
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
2929
#include "mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.h"
3030
#include "mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h"

mlir/lib/Conversion/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ add_subdirectory(GPUToVulkan)
88
add_subdirectory(LinalgToLLVM)
99
add_subdirectory(LinalgToSPIRV)
1010
add_subdirectory(LinalgToStandard)
11-
add_subdirectory(LoopsToGPU)
12-
add_subdirectory(LoopToStandard)
11+
add_subdirectory(SCFToGPU)
12+
add_subdirectory(SCFToStandard)
1313
add_subdirectory(StandardToLLVM)
1414
add_subdirectory(StandardToSPIRV)
1515
add_subdirectory(VectorToLLVM)
16-
add_subdirectory(VectorToLoops)
16+
add_subdirectory(VectorToSCF)

mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ add_mlir_conversion_library(MLIRLinalgToLLVM
1717
MLIRIR
1818
MLIRLinalgOps
1919
MLIRLLVMIR
20-
MLIRLoopToStandard
20+
MLIRSCFToStandard
2121
MLIRStandardToLLVM
22-
MLIRVectorToLLVM
23-
MLIRVectorToLoops
2422
MLIRTransforms
23+
MLIRVectorToLLVM
24+
MLIRVectorToSCF
2525
)

mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
#include "../PassDetail.h"
1212
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
13-
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
13+
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
1414
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h"
1515
#include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h"
1616
#include "mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h"
17-
#include "mlir/Conversion/VectorToLoops/ConvertVectorToLoops.h"
17+
#include "mlir/Conversion/VectorToSCF/VectorToSCF.h"
1818
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
1919
#include "mlir/Dialect/Linalg/IR/LinalgOps.h"
2020
#include "mlir/Dialect/Linalg/IR/LinalgTypes.h"
@@ -377,7 +377,7 @@ void ConvertLinalgToLLVMPass::runOnOperation() {
377377
populateAffineToStdConversionPatterns(patterns, &getContext());
378378
populateLoopToStdConversionPatterns(patterns, &getContext());
379379
populateStdToLLVMConversionPatterns(converter, patterns);
380-
populateVectorToLoopsConversionPatterns(patterns, &getContext());
380+
populateVectorToSCFConversionPatterns(patterns, &getContext());
381381
populateVectorToLLVMMatrixConversionPatterns(converter, patterns);
382382
populateVectorToLLVMConversionPatterns(converter, patterns);
383383
populateLinalgToLLVMConversionPatterns(converter, patterns, &getContext());

mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt renamed to mlir/lib/Conversion/SCFToGPU/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
add_mlir_conversion_library(MLIRLoopsToGPU
2-
LoopsToGPU.cpp
3-
LoopsToGPUPass.cpp
1+
add_mlir_conversion_library(MLIRSCFToGPU
2+
SCFToGPU.cpp
3+
SCFToGPUPass.cpp
44

55
ADDITIONAL_HEADER_DIRS
6-
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LoopsToGPU
6+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/SCFToGPU
77

88
DEPENDS
99
MLIRConversionPassIncGen

mlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp renamed to mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- LoopsToGPU.cpp - Convert an affine loop nest to a GPU kernel -------===//
1+
//===- SCFToGPU.cpp - Convert an affine loop nest to a GPU kernel -------===//
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.
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#include "mlir/Conversion/LoopsToGPU/LoopsToGPU.h"
15+
#include "mlir/Conversion/SCFToGPU/SCFToGPU.h"
1616

1717
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
1818
#include "mlir/Dialect/Affine/IR/AffineOps.h"

mlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp renamed to mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
//===- LoopsToGPUPass.cpp - Convert a loop nest to a GPU kernel -----------===//
1+
//===- SCFToGPUPass.cpp - Convert a loop nest to a GPU kernel -----------===//
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-
#include "mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h"
9+
#include "mlir/Conversion/SCFToGPU/SCFToGPUPass.h"
1010
#include "../PassDetail.h"
11-
#include "mlir/Conversion/LoopsToGPU/LoopsToGPU.h"
11+
#include "mlir/Conversion/SCFToGPU/SCFToGPU.h"
1212
#include "mlir/Dialect/Affine/IR/AffineOps.h"
1313
#include "mlir/Dialect/GPU/GPUDialect.h"
1414
#include "mlir/Dialect/SCF/SCF.h"
@@ -18,7 +18,7 @@
1818
#include "llvm/ADT/ArrayRef.h"
1919
#include "llvm/Support/CommandLine.h"
2020

21-
#define PASS_NAME "convert-loops-to-gpu"
21+
#define PASS_NAME "convert-scf-to-gpu"
2222
#define LOOPOP_TO_GPU_PASS_NAME "convert-loop-op-to-gpu"
2323

2424
using namespace mlir;
@@ -28,7 +28,7 @@ namespace {
2828
// A pass that traverses top-level loops in the function and converts them to
2929
// GPU launch operations. Nested launches are not allowed, so this does not
3030
// walk the function recursively to avoid considering nested loops.
31-
struct ForLoopMapper : public ConvertSimpleLoopsToGPUBase<ForLoopMapper> {
31+
struct ForLoopMapper : public ConvertSimpleSCFToGPUBase<ForLoopMapper> {
3232
ForLoopMapper() = default;
3333
ForLoopMapper(unsigned numBlockDims, unsigned numThreadDims) {
3434
this->numBlockDims = numBlockDims;
@@ -56,7 +56,7 @@ struct ForLoopMapper : public ConvertSimpleLoopsToGPUBase<ForLoopMapper> {
5656
// nested loops as the size of `numWorkGroups`. Within these any loop nest has
5757
// to be perfectly nested upto depth equal to size of `workGroupSize`.
5858
struct ImperfectlyNestedForLoopMapper
59-
: public ConvertLoopsToGPUBase<ImperfectlyNestedForLoopMapper> {
59+
: public ConvertSCFToGPUBase<ImperfectlyNestedForLoopMapper> {
6060
ImperfectlyNestedForLoopMapper() = default;
6161
ImperfectlyNestedForLoopMapper(ArrayRef<int64_t> numWorkGroups,
6262
ArrayRef<int64_t> workGroupSize) {
@@ -108,11 +108,10 @@ struct ParallelLoopToGpuPass
108108
} // namespace
109109

110110
std::unique_ptr<OperationPass<FuncOp>>
111-
mlir::createSimpleLoopsToGPUPass(unsigned numBlockDims,
112-
unsigned numThreadDims) {
111+
mlir::createSimpleSCFToGPUPass(unsigned numBlockDims, unsigned numThreadDims) {
113112
return std::make_unique<ForLoopMapper>(numBlockDims, numThreadDims);
114113
}
115-
std::unique_ptr<OperationPass<FuncOp>> mlir::createSimpleLoopsToGPUPass() {
114+
std::unique_ptr<OperationPass<FuncOp>> mlir::createSimpleSCFToGPUPass() {
116115
return std::make_unique<ForLoopMapper>();
117116
}
118117

mlir/lib/Conversion/LoopToStandard/CMakeLists.txt renamed to mlir/lib/Conversion/SCFToStandard/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
add_mlir_conversion_library(MLIRLoopToStandard
2-
LoopToStandard.cpp
1+
add_mlir_conversion_library(MLIRSCFToStandard
2+
SCFToStandard.cpp
33

44
ADDITIONAL_HEADER_DIRS
5-
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LoopToStandard
5+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/SCFToStandard
66

77
DEPENDS
88
MLIRConversionPassIncGen

mlir/lib/Conversion/LoopToStandard/LoopToStandard.cpp renamed to mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- LoopToStandard.cpp - ControlFlow to CFG conversion -----------------===//
1+
//===- SCFToStandard.cpp - ControlFlow to CFG conversion ------------------===//
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.
@@ -11,8 +11,8 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14+
#include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
1415
#include "../PassDetail.h"
15-
#include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h"
1616
#include "mlir/Dialect/SCF/SCF.h"
1717
#include "mlir/Dialect/StandardOps/IR/Ops.h"
1818
#include "mlir/IR/BlockAndValueMapping.h"
@@ -29,8 +29,7 @@ using namespace mlir::scf;
2929

3030
namespace {
3131

32-
struct LoopToStandardPass
33-
: public ConvertLoopToStandardBase<LoopToStandardPass> {
32+
struct SCFToStandardPass : public SCFToStandardBase<SCFToStandardPass> {
3433
void runOnOperation() override;
3534
};
3635

@@ -405,7 +404,7 @@ void mlir::populateLoopToStdConversionPatterns(
405404
patterns.insert<ForLowering, IfLowering, ParallelLowering>(ctx);
406405
}
407406

408-
void LoopToStandardPass::runOnOperation() {
407+
void SCFToStandardPass::runOnOperation() {
409408
OwningRewritePatternList patterns;
410409
populateLoopToStdConversionPatterns(patterns, &getContext());
411410
ConversionTarget target(getContext());
@@ -415,5 +414,5 @@ void LoopToStandardPass::runOnOperation() {
415414
}
416415

417416
std::unique_ptr<Pass> mlir::createLowerToCFGPass() {
418-
return std::make_unique<LoopToStandardPass>();
417+
return std::make_unique<SCFToStandardPass>();
419418
}

mlir/lib/Conversion/VectorToLoops/CMakeLists.txt renamed to mlir/lib/Conversion/VectorToSCF/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
add_mlir_conversion_library(MLIRVectorToLoops
2-
ConvertVectorToLoops.cpp
1+
add_mlir_conversion_library(MLIRVectorToSCF
2+
VectorToSCF.cpp
33

44
ADDITIONAL_HEADER_DIRS
5-
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLoops
5+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToSCF
66

77
LINK_COMPONENTS
88
Core

0 commit comments

Comments
 (0)