Skip to content

Commit b57e63b

Browse files
authored
libclc: Stop using asm declarations for r600 on amdgcn for get_global_size (#128692)
Comparing the case where each dimension is used alone, the only codegen difference is a missed addressing mode fold for the constant offset in the old version due to an ancient bug.
1 parent f95ad44 commit b57e63b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

libclc/amdgcn/lib/workitem/get_global_size.cl

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
#include <clc/clc.h>
22

3-
uint __clc_amdgcn_get_global_size_x(void) __asm("llvm.r600.read.global.size.x");
4-
uint __clc_amdgcn_get_global_size_y(void) __asm("llvm.r600.read.global.size.y");
5-
uint __clc_amdgcn_get_global_size_z(void) __asm("llvm.r600.read.global.size.z");
6-
73
_CLC_DEF _CLC_OVERLOAD size_t get_global_size(uint dim) {
84
switch (dim) {
95
case 0:
10-
return __clc_amdgcn_get_global_size_x();
6+
return __builtin_amdgcn_grid_size_x();
117
case 1:
12-
return __clc_amdgcn_get_global_size_y();
8+
return __builtin_amdgcn_grid_size_y();
139
case 2:
14-
return __clc_amdgcn_get_global_size_z();
10+
return __builtin_amdgcn_grid_size_z();
1511
default:
1612
return 1;
1713
}

0 commit comments

Comments
 (0)