1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib/Target/AMDGPU
Connor Abbott 8df9403bb9 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
..
AsmParser Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Disassembler CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
MCTargetDesc Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TargetInfo CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
Utils AMDGPU/R600: Emit rodata in text segment 2020-01-22 14:31:51 -05:00
AMDGPU.h [AMDGPU] Bundle loads before post-RA scheduler 2020-01-24 11:33:38 -08:00
AMDGPU.td
AMDGPUAliasAnalysis.cpp
AMDGPUAliasAnalysis.h
AMDGPUAlwaysInlinePass.cpp AMDGPU: Simplify getAddressSpace calls 2019-10-31 07:51:38 -07:00
AMDGPUAnnotateKernelFeatures.cpp
AMDGPUAnnotateUniformValues.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
AMDGPUArgumentUsageInfo.cpp
AMDGPUArgumentUsageInfo.h
AMDGPUAsmPrinter.cpp CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
AMDGPUAsmPrinter.h [AMDGPU] separate accounting for agprs 2019-10-02 00:26:58 +00:00
AMDGPUAtomicOptimizer.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
AMDGPUCallingConv.td AMDGPU: Allow i16 shader arguments 2020-01-27 06:55:32 -08:00
AMDGPUCallLowering.cpp AMDGPU/GlobalISel: Fix argument lowering for vectors of pointers 2020-01-09 16:29:44 -05:00
AMDGPUCallLowering.h
AMDGPUCodeGenPrepare.cpp AMDGPU: Implement FDIV optimizations in AMDGPUCodeGenPrepare 2020-01-23 16:57:43 -08:00
AMDGPUCombine.td AMDGPU/GlobalISel: Add pre-legalize combiner pass 2020-01-22 10:16:39 -05:00
AMDGPUFeatures.td
AMDGPUFixFunctionBitcasts.cpp
AMDGPUFrameLowering.cpp Use Align for TFL::TransientStackAlignment 2019-10-21 08:31:25 +00:00
AMDGPUFrameLowering.h [Alignment][NFC] Deprecate Align::None() 2020-01-24 12:53:58 +01:00
AMDGPUGenRegisterBankInfo.def AMDGPU/GlobalISel: Fix RegBankSelect for G_INSERT_VECTOR_ELT 2020-01-22 10:57:50 -05:00
AMDGPUGISel.td AMDGPU/GlobalISel: Select buffer atomics 2020-01-27 15:16:44 -05:00
AMDGPUGlobalISelUtils.cpp AMDGPU/GlobalISel: Add new utils file 2020-01-03 15:25:50 -05:00
AMDGPUGlobalISelUtils.h AMDGPU/GlobalISel: Add new utils file 2020-01-03 15:25:50 -05:00
AMDGPUHSAMetadataStreamer.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
AMDGPUHSAMetadataStreamer.h
AMDGPUInline.cpp [NFC] Refactor InlineResult for readability 2020-01-15 13:34:20 -08:00
AMDGPUInstrInfo.cpp
AMDGPUInstrInfo.h
AMDGPUInstrInfo.td AMDGPU: Remove custom node for exports 2020-01-15 18:33:15 -05:00
AMDGPUInstructions.td AMDGPU: Don't check constant address space for atomic stores 2020-01-24 12:15:09 -08:00
AMDGPUInstructionSelector.cpp AMDGPU/GlobalISel: Look through copies for source modifiers 2020-01-29 08:08:13 -08:00
AMDGPUInstructionSelector.h AMDGPU/GlobalISel: Manually select scalar f64 G_FNEG 2020-01-29 06:49:16 -08:00
AMDGPUISelDAGToDAG.cpp AMDGPU/GlobalISel: Eliminate SelectVOP3Mods_f32 2020-01-27 17:53:54 -05:00
AMDGPUISelLowering.cpp [AMDGPU] Allow narrowing muti-dword loads 2020-01-24 11:03:41 -08:00
AMDGPUISelLowering.h AMDGPU: Remove custom node for exports 2020-01-15 18:33:15 -05:00
AMDGPULegalizerInfo.cpp AMDGPU/GlobalISel: Select buffer atomics 2020-01-27 15:16:44 -05:00
AMDGPULegalizerInfo.h AMDGPU/GlobalISel: Select buffer atomics 2020-01-27 15:16:44 -05:00
AMDGPULibCalls.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
AMDGPULibFunc.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
AMDGPULibFunc.h Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
AMDGPULowerIntrinsics.cpp
AMDGPULowerKernelArguments.cpp [Alignement][NFC] Deprecate untyped CreateAlignedLoad 2020-01-23 13:34:32 +01:00
AMDGPULowerKernelAttributes.cpp
AMDGPUMachineCFGStructurizer.cpp [AMDGPU] Fixes -Wrange-loop-analysis warnings 2019-12-22 19:39:28 +01:00
AMDGPUMachineFunction.cpp AMDGPU: Refactor treatment of denormal mode 2019-11-19 19:55:43 +05:30
AMDGPUMachineFunction.h AMDGPU: Refactor treatment of denormal mode 2019-11-19 19:55:43 +05:30
AMDGPUMachineModuleInfo.cpp
AMDGPUMachineModuleInfo.h
AMDGPUMacroFusion.cpp
AMDGPUMacroFusion.h
AMDGPUMCInstLower.cpp [MC] Add parameter Address to MCInstPrinter::printInst 2020-01-06 20:42:22 -08:00
AMDGPUOpenCLEnqueuedBlockLowering.cpp
AMDGPUPerfHintAnalysis.cpp
AMDGPUPerfHintAnalysis.h
AMDGPUPreLegalizerCombiner.cpp AMDGPU/GlobalISel: Add pre-legalize combiner pass 2020-01-22 10:16:39 -05:00
AMDGPUPrintfRuntimeBinding.cpp [AMDGPU] add support for hostcall buffer pointer as hidden kernel argument 2019-11-20 15:53:55 +05:30
AMDGPUPromoteAlloca.cpp [Alignement][NFC] Deprecate untyped CreateAlignedLoad 2020-01-23 13:34:32 +01:00
AMDGPUPropagateAttributes.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
AMDGPUPTNote.h
AMDGPURegisterBankInfo.cpp AMDGPU/GlobalISel: Select buffer atomics 2020-01-27 15:16:44 -05:00
AMDGPURegisterBankInfo.h AMDPGPU/GlobalISel: Select more MUBUF global addressing modes 2020-01-27 07:28:36 -08:00
AMDGPURegisterBanks.td AMDGPU/GlobalISel: Replace handling of boolean values 2020-01-06 18:26:42 -05:00
AMDGPURegisterInfo.cpp AMDGPU: Remove outdated comment 2020-01-16 14:54:27 -05:00
AMDGPURegisterInfo.h AMDGPU/GlobalISel: Handle more G_INSERT cases 2019-10-07 19:16:26 +00:00
AMDGPURegisterInfo.td
AMDGPURewriteOutArguments.cpp [Alignment][NFC] Use Align with CreateAlignedStore 2020-01-23 17:34:32 +01:00
AMDGPUSearchableTables.td [AMDGPU][SILoadStoreOptimizer] Merge TBUFFER loads/stores 2019-11-20 22:59:30 +01:00
AMDGPUSubtarget.cpp [AMDGPU] Bundle loads before post-RA scheduler 2020-01-24 11:33:38 -08:00
AMDGPUSubtarget.h [AMDGPU] Fix vccz after v_readlane/v_readfirstlane to vcc_lo/hi 2020-01-28 10:52:17 +00:00
AMDGPUTargetMachine.cpp [AMDGPU] Bundle loads before post-RA scheduler 2020-01-24 11:33:38 -08:00
AMDGPUTargetMachine.h
AMDGPUTargetObjectFile.cpp
AMDGPUTargetObjectFile.h
AMDGPUTargetTransformInfo.cpp Resubmit: [DA][TTI][AMDGPU] Add option to select GPUDA with TTI 2020-01-24 10:39:40 -08:00
AMDGPUTargetTransformInfo.h Resubmit: [DA][TTI][AMDGPU] Add option to select GPUDA with TTI 2020-01-24 10:39:40 -08:00
AMDGPUUnifyDivergentExitNodes.cpp AMDGPU: Fix handling of infinite loops in fragment shaders 2020-01-29 17:13:25 +01:00
AMDGPUUnifyMetadata.cpp [AMDGPU] Fixes -Wrange-loop-analysis warnings 2019-12-22 19:39:28 +01:00
AMDILCFGStructurizer.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
AMDKernelCodeT.h
BUFInstructions.td AMDGPU/GlobalISel: Select buffer atomics 2020-01-27 15:16:44 -05:00
CaymanInstructions.td
CMakeLists.txt [AMDGPU] Bundle loads before post-RA scheduler 2020-01-24 11:33:38 -08:00
DSInstructions.td TableGen/GlobalISel: Add way for SDNodeXForm to work on timm 2020-01-09 17:37:52 -05:00
EvergreenInstructions.td
FLATInstructions.td AMDGPU/GlobalISel: Fix not using global atomics on gfx9+ 2020-01-27 07:42:42 -08:00
GCNDPPCombine.cpp [AMDGPU][DPP] Corrected DPP combiner 2019-11-20 15:56:45 +03:00
GCNHazardRecognizer.cpp Make more use of MachineInstr::mayLoadOrStore. 2019-12-19 11:51:52 +00:00
GCNHazardRecognizer.h
GCNILPSched.cpp Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each 2019-10-19 01:31:09 +00:00
GCNIterativeScheduler.cpp
GCNIterativeScheduler.h
GCNMinRegStrategy.cpp
GCNNSAReassign.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
GCNProcessors.td
GCNRegBankReassign.cpp AMDGPU: Fix ubsan error 2020-01-23 15:05:47 -05:00
GCNRegPressure.cpp [AMDGPU] Fix GCN regpressure trackers for INLINEASM instructions. 2020-01-27 17:25:25 +03:00
GCNRegPressure.h
GCNSchedStrategy.cpp [AMDGPU] Attempt to reschedule withou clustering 2020-01-27 10:27:16 -08:00
GCNSchedStrategy.h [AMDGPU] Attempt to reschedule withou clustering 2020-01-27 10:27:16 -08:00
LLVMBuild.txt
MIMGInstructions.td [AMDGPU] deduplicate tablegen predicates 2019-11-04 12:19:17 -08:00
R600.td
R600AsmPrinter.cpp [NFC] Fix trivial typos in comments 2020-01-06 10:50:26 +00:00
R600AsmPrinter.h
R600ClauseMergePass.cpp
R600ControlFlowFinalizer.cpp
R600Defines.h
R600EmitClauseMarkers.cpp
R600ExpandSpecialInstrs.cpp
R600FrameLowering.cpp
R600FrameLowering.h [Alignment][NFC] Deprecate Align::None() 2020-01-24 12:53:58 +01:00
R600InstrFormats.td
R600InstrInfo.cpp Update spelling of {analyze,insert,remove}Branch in strings and comments 2020-01-21 10:15:38 -06:00
R600InstrInfo.h Use MCRegister in copyPhysReg 2019-11-11 14:42:33 +05:30
R600Instructions.td AMDGPU: Eliminate more legacy codepred address space PatFrags 2020-01-09 10:29:32 -05:00
R600ISelLowering.cpp [DAG] Add helper for creating constant vector index with correct type. NFC. 2020-01-18 01:23:36 -05:00
R600ISelLowering.h
R600MachineFunctionInfo.cpp
R600MachineFunctionInfo.h
R600MachineScheduler.cpp
R600MachineScheduler.h
R600OpenCLImageTypeLoweringPass.cpp
R600OptimizeVectorRegisters.cpp
R600Packetizer.cpp
R600Processors.td
R600RegisterInfo.cpp
R600RegisterInfo.h [TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to true 2020-01-19 14:20:37 -08:00
R600RegisterInfo.td
R600Schedule.td
R700Instructions.td
SIAddIMGInit.cpp
SIAnnotateControlFlow.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SIDefines.h
SIFixSGPRCopies.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SIFixupVectorISel.cpp
SIFixVGPRCopies.cpp
SIFoldOperands.cpp [amdgpu] Remove unused header. NFC. 2020-01-08 11:32:09 -05:00
SIFormMemoryClauses.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SIFrameLowering.cpp [AMDGPU] Don't create MachinePointerInfos with an UndefValue pointer 2019-12-23 15:58:19 +00:00
SIFrameLowering.h [Alignment][NFC] Deprecate Align::None() 2020-01-24 12:53:58 +01:00
SIInsertSkips.cpp Resubmit: [AMDGPU] Invert the handling of skip insertion. 2020-01-22 13:18:32 +09:00
SIInsertWaitcnts.cpp [AMDGPU] Fix vccz after v_readlane/v_readfirstlane to vcc_lo/hi 2020-01-28 10:52:17 +00:00
SIInstrFormats.td
SIInstrInfo.cpp [AMDGPU] override isHighLatencyDef 2020-01-29 08:01:29 -08:00
SIInstrInfo.h [AMDGPU] override isHighLatencyDef 2020-01-29 08:01:29 -08:00
SIInstrInfo.td AMDGPU/GlobalISel: Eliminate SelectVOP3Mods_f32 2020-01-27 17:53:54 -05:00
SIInstructions.td AMDGPU/GlobalISel: Eliminate SelectVOP3Mods_f32 2020-01-27 17:53:54 -05:00
SIISelLowering.cpp AMDGPU: Fix not using f16 fsin/fcos 2020-01-27 08:59:59 -08:00
SIISelLowering.h CodeGen: Use LLT instead of EVT in getRegisterByName 2020-01-09 17:37:52 -05:00
SILoadStoreOptimizer.cpp AMDGPU/SILoadStoreOptimizer: Fix uninitialized variable error 2020-01-24 21:53:05 -08:00
SILowerControlFlow.cpp Resubmit: [AMDGPU] Invert the handling of skip insertion. 2020-01-22 13:18:32 +09:00
SILowerI1Copies.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SILowerSGPRSpills.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SIMachineFunctionInfo.cpp AMDGPU: Refactor treatment of denormal mode 2019-11-19 19:55:43 +05:30
SIMachineFunctionInfo.h AMDGPU: Refactor treatment of denormal mode 2019-11-19 19:55:43 +05:30
SIMachineScheduler.cpp [AMDGPU] override isHighLatencyDef 2020-01-29 08:01:29 -08:00
SIMachineScheduler.h AMDGPU/SI: make ~SIScheduleBlockCreator trivial 2019-11-11 21:51:59 -08:00
SIMemoryLegalizer.cpp [AMDGPU] Bundle loads before post-RA scheduler 2020-01-24 11:33:38 -08:00
SIModeRegister.cpp
SIOptimizeExecMasking.cpp AMDGPU: Use Register 2019-12-27 16:53:21 -05:00
SIOptimizeExecMaskingPreRA.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SIPeepholeSDWA.cpp AMDGPU: Fixed indeterminate map iteration in SIPeepholeSDWA 2019-12-02 12:08:49 +00:00
SIPostRABundler.cpp [AMDGPU] Bundle loads before post-RA scheduler 2020-01-24 11:33:38 -08:00
SIPreAllocateWWMRegs.cpp Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
SIProgramInfo.h [AMDGPU] separate accounting for agprs 2019-10-02 00:26:58 +00:00
SIRegisterInfo.cpp [TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to true 2020-01-19 14:20:37 -08:00
SIRegisterInfo.h [TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to true 2020-01-19 14:20:37 -08:00
SIRegisterInfo.td AMDGPU: Make VReg_1 only include 1 artificial register 2019-10-28 20:51:51 -07:00
SIRemoveShortExecBranches.cpp [AMDGPU] SIRemoveShortExecBranches should not remove branches exiting loops 2020-01-22 13:18:40 +09:00
SISchedule.td
SIShrinkInstructions.cpp AMDGPU: Don't fold S_NOPs with implicit operands 2019-10-30 14:40:56 -07:00
SIWholeQuadMode.cpp [AMDGPU] Remove unnecessary v_mov from a register to itself in WQM lowering. 2020-01-10 23:01:19 -05:00
SMInstructions.td [AMDGPU] deduplicate tablegen predicates 2019-11-04 12:19:17 -08:00
SOPInstructions.td Revert "AMDGPU: Temporary drop s_mul_hi_i/u32 patterns" 2020-01-27 08:07:21 -08:00
VIInstrFormats.td
VIInstructions.td
VOP1Instructions.td AMDGPU/GlobalISel: Select llvm.amdgcn.mov.dpp 2020-01-22 11:43:53 -05:00
VOP2Instructions.td AMDGPU/GlobalISel: Fix import of zext of s16 op patterns 2020-01-09 10:29:32 -05:00
VOP3Instructions.td AMDGPU/GlobalISel: Select V_ADD3_U32/V_XOR3_B32 2020-01-23 12:04:20 -05:00
VOP3PInstructions.td [AMDGPU] deduplicate tablegen predicates 2019-11-04 12:19:17 -08:00
VOPCInstructions.td AMDGPU: Remove VOP3Mods0Clamp0OMod 2020-01-07 15:10:08 -05:00
VOPInstructions.td [AMDGPU] copy OtherPredicates from pseudo to VOP3_Real 2019-09-26 21:06:17 +00:00