22 lines · plain
1; RUN: llc -mtriple=amdgcn-amd-amdhsa -global-isel -stop-after=irtranslator -o - %s | FileCheck %s2 3; Make sure that an intrinsic declaration that has side effects, but4; called with a readnone call site is translated to5; G_INTRINSIC_W_SIDE_EFFECTS6 7; CHECK-LABEL: name: getreg_callsite_attributes8; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.s.getreg)9; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.s.getreg)10define amdgpu_kernel void @getreg_callsite_attributes() {11 %reg0 = call i32 @llvm.amdgcn.s.getreg(i32 0)12 store volatile i32 %reg0, ptr addrspace(1) poison13 %reg1 = call i32 @llvm.amdgcn.s.getreg(i32 0) #114 store volatile i32 %reg1, ptr addrspace(1) poison15 ret void16}17 18declare i32 @llvm.amdgcn.s.getreg(i32) #019 20attributes #0 = { nounwind readonly inaccessiblememonly }21attributes #1 = { nounwind readnone }22