summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
diff options
context:
space:
mode:
authorMarek Olsak <marek.olsak@amd.com>2016-01-13 17:23:20 +0000
committerMarek Olsak <marek.olsak@amd.com>2016-01-13 17:23:20 +0000
commit46dadbfab2fe9504b0d145283f0b7258abcff6a9 (patch)
tree25fb52c4ca2ff7804e2309007a4cec7fc5840a04 /llvm/lib/Target/AMDGPU/SIISelLowering.cpp
parent774c0d689f43ad52699e774ddb18db957205abd6 (diff)
downloadbcm5719-llvm-46dadbfab2fe9504b0d145283f0b7258abcff6a9.tar.gz
bcm5719-llvm-46dadbfab2fe9504b0d145283f0b7258abcff6a9.zip
AMDGPU/SI: Fix a GPU hang with POS_W_FLOAT enabled
Reviewers: tstellarAMD, arsenm Subscribers: arsenm Differential Revision: http://reviews.llvm.org/D16037 llvm-svn: 257625
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIISelLowering.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIISelLowering.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 4206e6fb869..544867513d9 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -646,8 +646,15 @@ SDValue SITargetLowering::LowerFormalArguments(
// based on run-time states. Since we can't know what the final PSInputEna
// will look like, so we shouldn't do anything here and the user should take
// responsibility for the correct programming.
+ //
+ // Otherwise, the following restrictions apply:
+ // - At least one of PERSP_* (0xF) or LINEAR_* (0x70) must be enabled.
+ // - If POS_W_FLOAT (11) is enabled, at least one of PERSP_* must be
+ // enabled too.
if (Info->getShaderType() == ShaderType::PIXEL &&
- (Info->getPSInputAddr() & 0x7F) == 0) {
+ ((Info->getPSInputAddr() & 0x7F) == 0 ||
+ ((Info->getPSInputAddr() & 0xF) == 0 &&
+ Info->isPSInputAllocated(11)))) {
CCInfo.AllocateReg(AMDGPU::VGPR0);
CCInfo.AllocateReg(AMDGPU::VGPR1);
Info->markPSInputAllocated(0);
OpenPOWER on IntegriCloud