mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 22:43:53 +00:00
AMDGPU: Fix crash with dispatch.ptr intrinsic with non-HSA target
It might be better to let this be a select failure instead. llvm-svn: 257386
This commit is contained in:
parent
902e3a5e93
commit
f903e8d6a9
@ -1157,6 +1157,13 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
|
||||
|
||||
switch (IntrinsicID) {
|
||||
case Intrinsic::amdgcn_dispatch_ptr:
|
||||
if (!Subtarget->isAmdHsaOS()) {
|
||||
DiagnosticInfoUnsupported BadIntrin(*MF.getFunction(),
|
||||
"hsa intrinsic without hsa target");
|
||||
DAG.getContext()->diagnose(BadIntrin);
|
||||
return DAG.getUNDEF(VT);
|
||||
}
|
||||
|
||||
return CreateLiveInRegister(DAG, &AMDGPU::SReg_64RegClass,
|
||||
TRI->getPreloadedValue(MF, SIRegisterInfo::DISPATCH_PTR), VT);
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
|
||||
; RUN: not llc -mtriple=amdgcn-unknown-unknown -mcpu=kaveri -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=ERROR %s
|
||||
|
||||
; ERROR: error: unsupported hsa intrinsic without hsa target in test
|
||||
|
||||
; GCN-LABEL: {{^}}test:
|
||||
; GCN: enable_sgpr_dispatch_ptr = 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user