Skip to content

Commit aac23b0

Browse files
authored
[mlir][ROCDL] Stop setting amdgpu-implicitarg-num-bytes (#78498)
Clang stopped doing this late 2021 back in 33315ef, and no other frontent does this, so stop doing it.
1 parent 05e85e4 commit aac23b0

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,12 @@ class ROCDLDialectLLVMIRTranslationInterface
9393
// 1. Insert AMDGPU_KERNEL calling convention.
9494
// 2. Insert amdgpu-flat-work-group-size(1, 256) attribute unless the user
9595
// has overriden this value - 256 is the default in clang
96-
// 3. Insert amdgpu-implicitarg-num-bytes=56 (which must be set on OpenCL
97-
// and HIP kernels per Clang)
9896
llvm::Function *llvmFunc =
9997
moduleTranslation.lookupFunction(func.getName());
10098
llvmFunc->setCallingConv(llvm::CallingConv::AMDGPU_KERNEL);
10199
if (!llvmFunc->hasFnAttribute("amdgpu-flat-work-group-size")) {
102100
llvmFunc->addFnAttr("amdgpu-flat-work-group-size", "1,256");
103101
}
104-
llvmFunc->addFnAttr("amdgpu-implicitarg-num-bytes", "56");
105102
}
106103
// Override flat-work-group-size
107104
// TODO: update clients to rocdl.flat_work_group_size instead,

mlir/test/Target/LLVMIR/rocdl.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ llvm.func @rocdl_8bit_floats(%source: i32, %stoch: i32) -> i32 {
489489
llvm.return %source5 : i32
490490
}
491491

492-
// CHECK-DAG: attributes #[[$KERNEL_ATTRS]] = { "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" }
492+
// CHECK-DAG: attributes #[[$KERNEL_ATTRS]] = { "amdgpu-flat-work-group-size"="1,256" }
493493
// CHECK-DAG: attributes #[[$KERNEL_WORKGROUP_ATTRS]] = { "amdgpu-flat-work-group-size"="1,1024"
494494
// CHECK-DAG: attributes #[[$KNOWN_BLOCK_SIZE_ATTRS]] = { "amdgpu-flat-work-group-size"="128,128"
495495
// CHECK-DAG: ![[$RANGE]] = !{i32 0, i32 64}

0 commit comments

Comments
 (0)