llvm-project/llvm/lib
Connor Abbott 87d98c1495 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
2020-01-29 17:13:25 +01:00
..
Analysis Analysis: Add max recursison to isDereferenceableAndAlignedPointer 2020-01-29 06:48:24 -08:00
AsmParser Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
BinaryFormat DWARFDebugLine.cpp: Format unknown line number standard opcodes 2020-01-15 10:45:50 -05:00
Bitcode Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Bitstream [Bitstream] Delete skipAbbreviatedField which duplicates readAbbreviatedField 2019-12-25 18:55:02 -08:00
CodeGen GlobalISel: Assert on invalid bitcast in MIRBuilder 2020-01-29 07:49:39 -08:00
DWARFLinker Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DebugInfo [DebugInfo] Make most debug line prologue errors non-fatal to parsing 2020-01-29 10:23:41 +00:00
Demangle Revert "Add some missing includes to MicrosoftDemangle.cpp (PR44217)" 2019-12-04 11:10:07 -08:00
ExecutionEngine Another round of GCC5 fixes. 2020-01-29 02:09:24 +01:00
Frontend [OpenMP] Use the OpenMPIRBuilder for `omp parallel` 2019-12-30 13:57:13 -06:00
FuzzMutate Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Fuzzer
IR Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
IRReader [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
LTO Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
LineEditor Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Linker [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
MC Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
MCA Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Object [NFC] Fix unused variable warning. 2020-01-28 17:19:23 -08:00
ObjectYAML [Hexagon] Add support for Hexagon v67t microarchitecture (tiny core) 2020-01-21 11:35:10 -06:00
Option Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Passes Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ProfileData Another round of GCC5 fixes. 2020-01-29 02:09:24 +01:00
Remarks Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Support Work around PR44697 in CrashRecoveryContext 2020-01-29 16:35:07 +01:00
TableGen A bunch more implicit string conversions that my Clang didn't detect. 2020-01-29 00:30:16 +01:00
Target AMDGPU: Fix handling of infinite loops in fragment shaders 2020-01-29 17:13:25 +01:00
Testing
TextAPI Another round of GCC5 fixes. 2020-01-29 02:09:24 +01:00
ToolDrivers Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Transforms Fix MSVC lamdba default capture mode warning. NFCI. 2020-01-29 15:47:04 +00:00
WindowsManifest Revert "Temporarily revert "build: avoid hardcoding the libxml2 library name"" 2019-12-03 09:27:14 -08:00
XRay Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CMakeLists.txt [Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2. 2020-01-08 14:15:31 +03:00
LLVMBuild.txt [Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2. 2020-01-08 14:15:31 +03:00