Skip to content

Commit 677cc15

Browse files
committed
clang/AMDGPU: Defeat attribute optimization in attribute test
The optimization attributes are mostly noise for the purposes of the test. Also hoping this fixes https://lab.llvm.org/buildbot/#/builders/193/builds/940, which for some reason looks like the optimization isn't running.
1 parent 4120907 commit 677cc15

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

clang/test/CodeGenHIP/default-attributes.hip

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,53 @@
1717
// OPT: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
1818
// OPT: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata"
1919
//.
20+
__device__ void extern_func();
21+
2022
// OPTNONE: Function Attrs: convergent mustprogress noinline nounwind optnone
2123
// OPTNONE-LABEL: define {{[^@]+}}@_Z4funcv
2224
// OPTNONE-SAME: () #[[ATTR0:[0-9]+]] {
2325
// OPTNONE-NEXT: entry:
26+
// OPTNONE-NEXT: call void @_Z11extern_funcv() #[[ATTR3:[0-9]+]]
2427
// OPTNONE-NEXT: ret void
2528
//
26-
// OPT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
29+
// OPT: Function Attrs: convergent mustprogress nounwind
2730
// OPT-LABEL: define {{[^@]+}}@_Z4funcv
2831
// OPT-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] {
2932
// OPT-NEXT: entry:
33+
// OPT-NEXT: tail call void @_Z11extern_funcv() #[[ATTR3:[0-9]+]]
3034
// OPT-NEXT: ret void
3135
//
3236
__device__ void func() {
33-
37+
extern_func();
3438
}
3539

3640
// OPTNONE: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone
3741
// OPTNONE-LABEL: define {{[^@]+}}@_Z6kernelv
38-
// OPTNONE-SAME: () #[[ATTR1:[0-9]+]] {
42+
// OPTNONE-SAME: () #[[ATTR2:[0-9]+]] {
3943
// OPTNONE-NEXT: entry:
44+
// OPTNONE-NEXT: call void @_Z11extern_funcv() #[[ATTR3]]
4045
// OPTNONE-NEXT: ret void
4146
//
42-
// OPT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
47+
// OPT: Function Attrs: convergent mustprogress norecurse nounwind
4348
// OPT-LABEL: define {{[^@]+}}@_Z6kernelv
44-
// OPT-SAME: () local_unnamed_addr #[[ATTR1:[0-9]+]] {
49+
// OPT-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] {
4550
// OPT-NEXT: entry:
51+
// OPT-NEXT: tail call void @_Z11extern_funcv() #[[ATTR3]]
4652
// OPT-NEXT: ret void
4753
//
4854
__global__ void kernel() {
49-
55+
extern_func();
5056
}
5157
//.
5258
// OPTNONE: attributes #[[ATTR0]] = { convergent mustprogress noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
53-
// OPTNONE: attributes #[[ATTR1]] = { convergent mustprogress noinline norecurse nounwind optnone "amdgpu-flat-work-group-size"="1,1024" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
59+
// OPTNONE: attributes #[[ATTR1:[0-9]+]] = { convergent nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
60+
// OPTNONE: attributes #[[ATTR2]] = { convergent mustprogress noinline norecurse nounwind optnone "amdgpu-flat-work-group-size"="1,1024" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
61+
// OPTNONE: attributes #[[ATTR3]] = { convergent nounwind }
5462
//.
55-
// OPT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" }
56-
// OPT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) "amdgpu-flat-work-group-size"="1,1024" "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
63+
// OPT: attributes #[[ATTR0]] = { convergent mustprogress nounwind "amdgpu-waves-per-eu"="4,10" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" }
64+
// OPT: attributes #[[ATTR1:[0-9]+]] = { convergent nounwind "amdgpu-waves-per-eu"="4,10" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" }
65+
// OPT: attributes #[[ATTR2]] = { convergent mustprogress norecurse nounwind "amdgpu-flat-work-group-size"="1,1024" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
66+
// OPT: attributes #[[ATTR3]] = { convergent nounwind }
5767
//.
5868
// OPTNONE: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
5969
// OPTNONE: [[META1:![0-9]+]] = !{i32 1, !"amdgpu_printf_kind", !"hostcall"}

0 commit comments

Comments
 (0)