Skip to content

Commit dbd4a0d

Browse files
authored
[MLIR][GPUCommon] Remove typed pointer support (#70735)
This commit removes the GPUCommon's lowering support for 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 d56eb82 commit dbd4a0d

12 files changed

+50
-202
lines changed

mlir/include/mlir/Conversion/Passes.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,7 @@ def GpuToLLVMConversionPass : Pass<"gpu-to-llvm", "ModuleOp"> {
449449
Option<"gpuBinaryAnnotation", "gpu-binary-annotation", "std::string",
450450
/*default=*/"gpu::getDefaultGpuBinaryAnnotation()",
451451
"Annotation attribute string for GPU binary"
452-
>,
453-
Option<"useOpaquePointers", "use-opaque-pointers", "bool",
454-
/*default=*/"true", "Generate LLVM IR using opaque pointers "
455-
"instead of typed pointers">,
452+
>
456453
];
457454

458455
let dependentDialects = [

mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class GEPIndicesAdaptor {
210210
/// string (operations inserted at the builder insertion point).
211211
Value createGlobalString(Location loc, OpBuilder &builder, StringRef name,
212212
StringRef value, Linkage linkage,
213-
bool useOpaquePointers);
213+
bool useOpaquePointers = true);
214214

215215
/// LLVM requires some operations to be inside of a Module operation. This
216216
/// function confirms that the Operation has the desired properties.

mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp

Lines changed: 39 additions & 106 deletions
Large diffs are not rendered by default.

mlir/test/Conversion/GPUCommon/lower-2to4-sparse-to-gpu-runtime-calls.mlir

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

33
module attributes {gpu.container_module} {
44

mlir/test/Conversion/GPUCommon/lower-alloc-to-gpu-runtime-calls.mlir

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

33
module attributes {gpu.container_module} {
44
// CHECK-LABEL: llvm.func @main

mlir/test/Conversion/GPUCommon/lower-launch-func-to-gpu-runtime-calls.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: mlir-opt %s --gpu-to-llvm="gpu-binary-annotation=nvvm.cubin use-opaque-pointers=1" -split-input-file | FileCheck %s
2-
// RUN: mlir-opt %s --gpu-to-llvm="gpu-binary-annotation=rocdl.hsaco use-opaque-pointers=1" -split-input-file | FileCheck %s --check-prefix=ROCDL
1+
// RUN: mlir-opt %s --gpu-to-llvm="gpu-binary-annotation=nvvm.cubin" -split-input-file | FileCheck %s
2+
// RUN: mlir-opt %s --gpu-to-llvm="gpu-binary-annotation=rocdl.hsaco" -split-input-file | FileCheck %s --check-prefix=ROCDL
33

44
module attributes {gpu.container_module} {
55

mlir/test/Conversion/GPUCommon/lower-memcpy-to-gpu-runtime-calls.mlir

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

33
module attributes {gpu.container_module} {
44

mlir/test/Conversion/GPUCommon/lower-memset-to-gpu-runtime-calls.mlir

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

33
module attributes {gpu.container_module} {
44

mlir/test/Conversion/GPUCommon/lower-sparse-to-gpu-runtime-calls.mlir

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

33
module attributes {gpu.container_module} {
44

mlir/test/Conversion/GPUCommon/lower-wait-to-gpu-runtime-calls.mlir

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

33
module attributes {gpu.container_module} {
44

mlir/test/Conversion/GPUCommon/transfer_write.mlir

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

33
func.func @warp_extract(%arg0: index, %arg1: memref<1024x1024xf32>, %arg2: index, %arg3: vector<1xf32>) {
44
%c0 = arith.constant 0 : index

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

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

0 commit comments

Comments
 (0)