Skip to content

Commit 5572996

Browse files
committed
[Refactor] Force users to use create* function autogenerated from tablegen and delete handwritten version
1 parent c03637b commit 5572996

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

mlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "mlir/Conversion/GPUToROCDL/Runtimes.h"
1212
#include "mlir/Conversion/LLVMCommon/LoweringOptions.h"
13+
#include "mlir/Pass/Pass.h"
1314
#include "llvm/ADT/DenseSet.h"
1415
#include <cstddef>
1516
#include <memory>
@@ -44,18 +45,6 @@ void populateGpuToROCDLConversionPatterns(const LLVMTypeConverter &converter,
4445
/// Configure target to convert from the GPU dialect to ROCDL.
4546
void configureGpuToROCDLConversionLegality(ConversionTarget &target);
4647

47-
/// Creates a pass that lowers GPU dialect operations to ROCDL counterparts. The
48-
/// index bitwidth used for the lowering of the device side index computations
49-
/// is configurable.
50-
std::unique_ptr<OperationPass<gpu::GPUModuleOp>>
51-
createLowerGpuOpsToROCDLOpsPass(
52-
const std::string &chipset = "gfx900",
53-
unsigned indexBitwidth = kDeriveIndexBitwidthFromDataLayout,
54-
bool useBarePtrCallConv = false,
55-
gpu::amd::Runtime runtime = gpu::amd::Runtime::Unknown,
56-
const std::optional<llvm::SmallDenseSet<llvm::StringRef>> &allowedDialects =
57-
std::nullopt);
58-
5948
} // namespace mlir
6049

6150
#endif // MLIR_CONVERSION_GPUTOROCDL_GPUTOROCDLPASS_H_

mlir/include/mlir/Conversion/Passes.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ def ConvertGpuOpsToNVVMOps : Pass<"convert-gpu-to-nvvm", "gpu::GPUModuleOp"> {
624624

625625
def ConvertGpuOpsToROCDLOps : Pass<"convert-gpu-to-rocdl", "gpu::GPUModuleOp"> {
626626
let summary = "Generate ROCDL operations for gpu operations";
627-
let constructor = "mlir::createLowerGpuOpsToROCDLOpsPass()";
628627
let dependentDialects = [
629628
"ROCDL::ROCDLDialect",
630629
"amdgpu::AMDGPUDialect",

mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "mlir/Dialect/MemRef/IR/MemRef.h"
3737
#include "mlir/Dialect/Vector/IR/VectorOps.h"
3838
#include "mlir/IR/BuiltinAttributes.h"
39-
#include "mlir/Pass/Pass.h"
4039
#include "mlir/Transforms/DialectConversion.h"
4140
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
4241

@@ -288,6 +287,8 @@ struct GPUShuffleOpLowering : public ConvertOpToLLVMPattern<gpu::ShuffleOp> {
288287
struct LowerGpuOpsToROCDLOpsPass final
289288
: public impl::ConvertGpuOpsToROCDLOpsBase<LowerGpuOpsToROCDLOpsPass> {
290289
LowerGpuOpsToROCDLOpsPass() = default;
290+
LowerGpuOpsToROCDLOpsPass(ConvertGpuOpsToROCDLOpsOptions options)
291+
: ConvertGpuOpsToROCDLOpsBase(options) {}
291292
LowerGpuOpsToROCDLOpsPass(
292293
const std::string &chipset, unsigned indexBitwidth,
293294
bool useBarePtrCallConv, gpu::amd::Runtime runtime,
@@ -506,12 +507,3 @@ void mlir::populateGpuToROCDLConversionPatterns(
506507

507508
populateMathToROCDLConversionPatterns(converter, patterns);
508509
}
509-
510-
std::unique_ptr<OperationPass<gpu::GPUModuleOp>>
511-
mlir::createLowerGpuOpsToROCDLOpsPass(
512-
const std::string &chipset, unsigned indexBitwidth, bool useBarePtrCallConv,
513-
gpu::amd::Runtime runtime,
514-
const std::optional<llvm::SmallDenseSet<StringRef>> &allowedDialects) {
515-
return std::make_unique<LowerGpuOpsToROCDLOpsPass>(
516-
chipset, indexBitwidth, useBarePtrCallConv, runtime, allowedDialects);
517-
}

0 commit comments

Comments
 (0)