File tree Expand file tree Collapse file tree 5 files changed +37
-7
lines changed Expand file tree Collapse file tree 5 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -401,13 +401,6 @@ void AMDGPUTargetCodeGenInfo::setTargetAttributes(
401
401
if (FD)
402
402
setFunctionDeclAttributes (FD, F, M);
403
403
404
- const bool IsHIPKernel =
405
- M.getLangOpts ().HIP && FD && FD->hasAttr <CUDAGlobalAttr>();
406
-
407
- // TODO: This should be moved to language specific attributes instead.
408
- if (IsHIPKernel)
409
- F->addFnAttr (" uniform-work-group-size" , " true" );
410
-
411
404
if (M.getContext ().getTargetInfo ().allowAMDGPUUnsafeFPAtomics ())
412
405
F->addFnAttr (" amdgpu-unsafe-fp-atomics" , " true" );
413
406
Original file line number Diff line number Diff line change 10
10
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
11
11
// RUN: -verify -o - -x hip %s | FileCheck -check-prefix=NAMD %s
12
12
13
+ // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -foffload-uniform-block \
14
+ // RUN: -fcuda-is-device -emit-llvm -o - -x hip %s \
15
+ // RUN: | FileCheck -check-prefixes=CHECK,DEFAULT %s
16
+ // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fno-offload-uniform-block \
17
+ // RUN: -fcuda-is-device -emit-llvm -o - -x hip %s \
18
+ // RUN: | FileCheck -check-prefixes=NOUB %s
19
+
13
20
#include " Inputs/cuda.h"
14
21
15
22
__global__ void flat_work_group_size_default () {
16
23
// CHECK: define{{.*}} amdgpu_kernel void @_Z28flat_work_group_size_defaultv() [[FLAT_WORK_GROUP_SIZE_DEFAULT:#[0-9]+]]
24
+ // NOUB: define{{.*}} void @_Z28flat_work_group_size_defaultv() [[NOUB:#[0-9]+]]
17
25
}
18
26
19
27
__attribute__ ((amdgpu_flat_work_group_size(32 , 64 ))) // expected-no-diagnostics
@@ -45,3 +53,5 @@ __global__ void num_vgpr_64() {
45
53
// CHECK-DAG: attributes [[WAVES_PER_EU_2]] = {{.*}}"amdgpu-waves-per-eu"="2"
46
54
// CHECK-DAG: attributes [[NUM_SGPR_32]] = {{.*}}"amdgpu-num-sgpr"="32"
47
55
// CHECK-DAG: attributes [[NUM_VGPR_64]] = {{.*}}"amdgpu-num-vgpr"="64"
56
+
57
+ // NOUB-NOT: "uniform-work-group-size"="true"
Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL1.2 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
2
2
// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-NONUNIFORM
3
3
// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -cl-uniform-work-group-size -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
4
+ // RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -foffload-uniform-block -o - %s 2>&1 | FileCheck %s -check-prefixes CHECK,CHECK-UNIFORM
4
5
5
6
kernel void ker () {};
6
7
// CHECK: define{{.*}}@ker() #0
Original file line number Diff line number Diff line change 169
169
// RUN: %clang -### -nogpuinc -nogpulib -fhip-fp32-correctly-rounded-divide-sqrt \
170
170
// RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefixes=CRDS %s
171
171
// CRDS-NOT: "-f{{(no-)?}}hip-fp32-correctly-rounded-divide-sqrt"
172
+ / Check -fno-offload-uniform-block is passed to clang -cc1 but
173
+ // (default) -fno-offload-uniform-block is not.
174
+
175
+ // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fno-offload-uniform-block \
176
+ // RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=NOUNIBLK %s
177
+
178
+ // NOUNIBLK: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-fno-offload-uniform-block"
179
+ // NOUNIBLK: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-fno-offload-uniform-block"
180
+
181
+ // RUN: %clang -### -nogpuinc -nogpulib -foffload-uniform-block \
182
+ // RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=UNIBLK %s
183
+
184
+ // UNIBLK: "-cc1"{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-foffload-uniform-block"
185
+ // UNIBLK: "-cc1"{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-foffload-uniform-block"
186
+
187
+ // RUN: %clang -### -nogpuinc -nogpulib \
188
+ // RUN: --cuda-gpu-arch=gfx906 %s 2>&1 | FileCheck -check-prefix=DEFUNIBLK %s
189
+
190
+ // DEFUNIBLK-NOT: "-f{{(no-)?}}offload-uniform-block"
191
+
192
+ // Check no warnings for -f[no-]offload-uniform-block.
193
+
194
+ // RUN: %clang -fdriver-only -Werror --target=x86_64-unknown-linux-gnu -nogpuinc -nogpulib -fno-offload-uniform-block \
195
+ // RUN: -foffload-uniform-block --cuda-gpu-arch=gfx906 %s 2>&1 | count 0
Original file line number Diff line number Diff line change 17
17
// RUN: %clang -S -### -cl-denorms-are-zero %s 2>&1 | FileCheck --check-prefix=CHECK-DENORMS-ARE-ZERO %s
18
18
// RUN: %clang -S -### -cl-fp32-correctly-rounded-divide-sqrt %s 2>&1 | FileCheck --check-prefix=CHECK-ROUND-DIV %s
19
19
// RUN: %clang -S -### -cl-uniform-work-group-size %s 2>&1 | FileCheck --check-prefix=CHECK-UNIFORM-WG %s
20
+ // RUN: %clang -S -### -foffload-uniform-block %s 2>&1 | FileCheck --check-prefix=CHECK-UNIFORM-WG %s
21
+ // RUN: %clang -S -### -fno-offload-uniform-block -cl-uniform-work-group-size %s 2>&1 | FileCheck --check-prefix=CHECK-UNIFORM-WG %s
20
22
// RUN: not %clang -cl-std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s
21
23
// RUN: not %clang -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s
22
24
// RUN: %clang -S -### -target spir-unknown-unknown %s 2>&1 | FileCheck --check-prefix=CHECK-W-SPIR-COMPAT %s
You can’t perform that action at this time.
0 commit comments