1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -global-isel -stop-after=irtranslator -o - %s | FileCheck %s
3 ; Make sure that an intrinsic declaration that has side effects, but
4 ; called with a readnone call site is translated to
5 ; G_INTRINSIC_W_SIDE_EFFECTS
7 ; CHECK-LABEL: name: getreg_callsite_attributes
8 ; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.s.getreg)
9 ; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.s.getreg)
10 define amdgpu_kernel void @getreg_callsite_attributes() {
11 %reg0 = call i32 @llvm.amdgcn.s.getreg(i32 0)
12 store volatile i32 %reg0, i32 addrspace(1)* undef
13 %reg1 = call i32 @llvm.amdgcn.s.getreg(i32 0) #1
14 store volatile i32 %reg1, i32 addrspace(1)* undef
18 declare i32 @llvm.amdgcn.s.getreg(i32) #0
20 attributes #0 = { nounwind readonly inaccessiblememonly }
21 attributes #1 = { nounwind readnone }