AMDGPU: Error on graphics shaders with HSA

I've found myself pointlessly debugging problems from running
graphics tests with an HSA triple a few times, so stop this from
happening again.

llvm-svn: 251858
This commit is contained in:
Matt Arsenault 2015-11-02 23:23:02 +00:00
parent 0ed9aeaa5f
commit d48da14269
2 changed files with 26 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "SIISelLowering.h"
#include "AMDGPU.h"
#include "AMDGPUDiagnosticInfoUnsupported.h"
#include "AMDGPUIntrinsicInfo.h"
#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.h"
@ -510,6 +511,13 @@ SDValue SITargetLowering::LowerFormalArguments(
FunctionType *FType = MF.getFunction()->getFunctionType();
SIMachineFunctionInfo *Info = MF.getInfo<SIMachineFunctionInfo>();
if (Subtarget->isAmdHsaOS() && Info->getShaderType() != ShaderType::COMPUTE) {
const Function *Fn = MF.getFunction();
DiagnosticInfoUnsupported NoGraphicsHSA(*Fn, "non-compute shaders with HSA");
DAG.getContext()->diagnose(NoGraphicsHSA);
return SDValue();
}
// FIXME: We currently assume all calling conventions are kernels.
SmallVector<ISD::InputArg, 16> Splits;

View File

@ -0,0 +1,18 @@
; RUN: not llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa < %s 2>&1 | FileCheck %s
; CHECK: error: unsupported non-compute shaders with HSA in pixel_shader
define void @pixel_shader() #0 {
ret void
}
define void @vertex_shader() #1 {
ret void
}
define void @geometry_shader() #2 {
ret void
}
attributes #0 = { nounwind "ShaderType"="0" }
attributes #1 = { nounwind "ShaderType"="1" }
attributes #2 = { nounwind "ShaderType"="2" }