Skip to content

Commit 02307a1

Browse files
authored
[MLIR][GPUToNVVM] Remove typed pointer support (#70861)
This commit removes the support for lowering GPU to NVVM dialect with typed pointers. Typed pointers have been deprecated for a while now and it's planned to soon remove them from the LLVM dialect. Related PSA: https://discourse.llvm.org/t/psa-removal-of-typed-pointers-from-the-llvm-dialect/74502
1 parent 1908f47 commit 02307a1

File tree

11 files changed

+9
-67
lines changed

11 files changed

+9
-67
lines changed

mlir/include/mlir/Conversion/Passes.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,7 @@ def ConvertGpuOpsToNVVMOps : Pass<"convert-gpu-to-nvvm", "gpu::GPUModuleOp"> {
495495
Option<"useBarePtrCallConv", "use-bare-ptr-memref-call-conv", "bool",
496496
/*default=*/"false",
497497
"Replace memref arguments in GPU functions with bare pointers. "
498-
"All memrefs must have static shape.">,
499-
Option<"useOpaquePointers", "use-opaque-pointers", "bool",
500-
/*default=*/"true", "Generate LLVM IR using opaque pointers "
501-
"instead of typed pointers">,
498+
"All memrefs must have static shape.">
502499
];
503500
}
504501

mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ struct LowerGpuOpsToNVVMOpsPass
227227
DataLayout(cast<DataLayoutOpInterface>(m.getOperation())));
228228
if (indexBitwidth != kDeriveIndexBitwidthFromDataLayout)
229229
options.overrideIndexBitwidth(indexBitwidth);
230-
options.useOpaquePointers = useOpaquePointers;
231230
options.useBarePtrCallConv = useBarePtrCallConv;
232231

233232
// Apply in-dialect lowering. In-dialect lowering will replace

mlir/test/Conversion/GPUCommon/lower-memory-space-attrs-typed-pointers.mlir

Lines changed: 0 additions & 15 deletions
This file was deleted.

mlir/test/Conversion/GPUCommon/lower-memory-space-attrs.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-rocdl='use-opaque-pointers=1' | FileCheck %s --check-prefixes=CHECK,ROCDL
2-
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm='use-opaque-pointers=1' | FileCheck %s --check-prefixes=CHECK,NVVM
2+
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm | FileCheck %s --check-prefixes=CHECK,NVVM
33

44
gpu.module @kernel {
55
gpu.func @private(%arg0: f32) private(%arg1: memref<4xf32, #gpu.address_space<private>>) {

mlir/test/Conversion/GPUCommon/memory-attrbution.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt -allow-unregistered-dialect --convert-gpu-to-nvvm='use-opaque-pointers=1' --split-input-file %s | FileCheck --check-prefix=NVVM %s
1+
// RUN: mlir-opt -allow-unregistered-dialect --convert-gpu-to-nvvm --split-input-file %s | FileCheck --check-prefix=NVVM %s
22
// RUN: mlir-opt -allow-unregistered-dialect --convert-gpu-to-rocdl='use-opaque-pointers=1' --split-input-file %s | FileCheck --check-prefix=ROCDL %s
33

44
gpu.module @kernel {

mlir/test/Conversion/GPUCommon/memref-arg-attrs.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-rocdl='use-opaque-pointers=1 use-bare-ptr-memref-call-conv=0' | FileCheck %s --check-prefixes=CHECK,ROCDL
2-
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm='use-opaque-pointers=1 use-bare-ptr-memref-call-conv=0' | FileCheck %s --check-prefixes=CHECK,NVVM
2+
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm='use-bare-ptr-memref-call-conv=0' | FileCheck %s --check-prefixes=CHECK,NVVM
33

44
gpu.module @kernel {
55
gpu.func @test_func_readonly(%arg0 : memref<f32> {llvm.readonly} ) {

mlir/test/Conversion/GPUCommon/memref-arg-noalias-attrs.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-rocdl='use-opaque-pointers=1 use-bare-ptr-memref-call-conv=1' | FileCheck %s --check-prefixes=CHECK,ROCDL
2-
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm='use-opaque-pointers=1 use-bare-ptr-memref-call-conv=1' | FileCheck %s --check-prefixes=CHECK,NVVM
2+
// RUN: mlir-opt %s -split-input-file -convert-gpu-to-nvvm='use-bare-ptr-memref-call-conv=1' | FileCheck %s --check-prefixes=CHECK,NVVM
33

44
gpu.module @kernel {
55
gpu.func @func_with_noalias_attr(%arg0 : memref<f32> {llvm.noalias} ) {

mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm-32b.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -convert-gpu-to-nvvm='index-bitwidth=32 use-opaque-pointers=1' -split-input-file | FileCheck %s
1+
// RUN: mlir-opt %s -convert-gpu-to-nvvm='index-bitwidth=32' -split-input-file | FileCheck %s
22

33
// RUN: mlir-opt %s -transform-interpreter | FileCheck %s
44

mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -convert-gpu-to-nvvm='has-redux=1 use-opaque-pointers=1' -split-input-file | FileCheck %s
1+
// RUN: mlir-opt %s -convert-gpu-to-nvvm='has-redux=1' -split-input-file | FileCheck %s
22
// RUN: mlir-opt %s -transform-interpreter | FileCheck %s
33

44
gpu.module @test_module_0 {

mlir/test/Conversion/GPUToNVVM/typed-pointers.mlir

Lines changed: 0 additions & 39 deletions
This file was deleted.

mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: mlir-opt --convert-gpu-to-nvvm='use-opaque-pointers=1' --split-input-file %s | FileCheck %s
2-
// RUN: mlir-opt --convert-gpu-to-nvvm="index-bitwidth=32 use-opaque-pointers=1" --split-input-file %s | FileCheck --check-prefix=CHECK32 %s
1+
// RUN: mlir-opt --convert-gpu-to-nvvm --split-input-file %s | FileCheck %s
2+
// RUN: mlir-opt --convert-gpu-to-nvvm="index-bitwidth=32" --split-input-file %s | FileCheck --check-prefix=CHECK32 %s
33

44
gpu.module @test_module {
55

0 commit comments

Comments
 (0)