Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9929,9 +9929,9 @@ SDValue SITargetLowering::LowerINTRINSIC_VOID(SDValue Op,
return SDValue(NewMI, 0);
}
case Intrinsic::amdgcn_s_prefetch_data: {
// For non-global address space preserve the chain and remove the call.
if (!AMDGPU::isFlatGlobalAddrSpace(cast<MemSDNode>(Op)->getAddressSpace()))
return Op.getOperand(0);
report_fatal_error("s_prefetch_data only supports global or constant"
" memory");
return Op;
}
default: {
Expand Down
8 changes: 8 additions & 0 deletions llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.prefetch.data.err.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
; RUN: not --crash llc -march=amdgcn -mcpu=gfx1200 < %s 2>&1 | FileCheck --check-prefixes=GCN-ERR %s

; GCN-ERR: LLVM ERROR: s_prefetch_data only supports global or constant memory
define amdgpu_ps void @prefetch_data_sgpr_base_imm_len_local(ptr addrspace(3) inreg %ptr) {
entry:
tail call void @llvm.amdgcn.s.prefetch.data.p3(ptr addrspace(3) %ptr, i32 31)
ret void
}
9 changes: 0 additions & 9 deletions llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.prefetch.data.ll
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,6 @@ entry:
ret void
}

define amdgpu_ps void @prefetch_data_sgpr_base_imm_len_local(ptr addrspace(3) inreg %ptr) {
; GCN-LABEL: prefetch_data_sgpr_base_imm_len_local:
; GCN: ; %bb.0: ; %entry
; GCN-NEXT: s_endpgm
entry:
tail call void @llvm.amdgcn.s.prefetch.data.p3(ptr addrspace(3) %ptr, i32 31)
ret void
}

define amdgpu_ps void @prefetch_data_vgpr_base_imm_len(ptr addrspace(4) %ptr) {
; GCN-LABEL: prefetch_data_vgpr_base_imm_len:
; GCN: ; %bb.0: ; %entry
Expand Down