Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang...
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / uniform-work-group-prevent-attribute-propagation.ll
blob2d5ff045d12e5a1112da1db6dcb00d38482bb3d2
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2 ; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor < %s | FileCheck %s
4 ; Function added to prevent attributor from deleting call sites.
6 ; Two kernels with different values of the uniform-work-group-attribute call the same function
7 @x = global i32 0
9 ;.
10 ; CHECK: @[[X:[a-zA-Z0-9_$"\\.-]+]] = global i32 0
12 define void @func() #0 {
13 ; CHECK-LABEL: define {{[^@]+}}@func
14 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
15 ; CHECK-NEXT:    store i32 0, ptr @x, align 4
16 ; CHECK-NEXT:    ret void
18   store i32 0, ptr @x
19   ret void
22 define amdgpu_kernel void @kernel1() #1 {
23 ; CHECK-LABEL: define {{[^@]+}}@kernel1
24 ; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
25 ; CHECK-NEXT:    call void @func()
26 ; CHECK-NEXT:    ret void
28   call void @func()
29   ret void
32 define amdgpu_kernel void @kernel2() #2 {
33 ; CHECK-LABEL: define {{[^@]+}}@kernel2
34 ; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
35 ; CHECK-NEXT:    call void @func()
36 ; CHECK-NEXT:    ret void
38   call void @func()
39   ret void
42 attributes #1 = { "uniform-work-group-size"="true" }
44 ; CHECK: attributes #[[ATTR0]] = { "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" "uniform-work-group-size"="false" }
45 ; CHECK: attributes #[[ATTR1]] = { "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" "uniform-work-group-size"="true" }
46 ; CHECK: attributes #[[ATTR2]] = { "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" "uniform-work-group-size"="false" }