aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2019-11-27 14:09:13 +0100
committerConnor Abbott <cwabbott0@gmail.com>2020-01-29 17:13:25 +0100
commit87d98c149504f9b0751189744472d7cc94883960 (patch)
tree8a7592143aef105d6e73feb8131e45852e72f2e1 /llvm/lib/CodeGen/MachineScheduler.cpp
parent94e8ef4d4c7f608a2cc9673e7a1a0937f6b7935d (diff)
downloadllvm-87d98c149504f9b0751189744472d7cc94883960.zip
llvm-87d98c149504f9b0751189744472d7cc94883960.tar.gz
llvm-87d98c149504f9b0751189744472d7cc94883960.tar.bz2
AMDGPU: Fix handling of infinite loops in fragment shaders
Summary: Due to the fact that kill is just a normal intrinsic, even though it's supposed to terminate the thread, we can end up with provably infinite loops that are actually supposed to end successfully. The AMDGPUUnifyDivergentExitNodes pass breaks up these loops, but because there's no obvious place to make the loop branch to, it just makes it return immediately, which skips the exports that are supposed to happen at the end and hangs the GPU if all the threads end up being killed. While it would be nice if the fact that kill terminates the thread were modeled in the IR, I think that the structurizer as-is would make a mess if we did that when the kill is inside control flow. For now, we just add a null export at the end to make sure that it always exports something, which fixes the immediate problem without penalizing the more common case. This means that we sometimes do two "done" exports when only some of the threads enter the discard loop, but from tests the hardware seems ok with that. This fixes dEQP-VK.graphicsfuzz.while-inside-switch with radv. Reviewers: arsenm, nhaehnle Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70781
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
0 files changed, 0 insertions, 0 deletions