diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp index f236f10ba75..c6396de89c4 100644 --- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp +++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp @@ -215,6 +215,14 @@ void GCNHazardRecognizer::AdvanceCycle() { if (!CurrCycleInstr) return; + // Do not track non-instructions which do not affect the wait states. + // If included, these instructions can lead to buffer overflow such that + // detectable hazards are missed. + if (CurrCycleInstr->getOpcode() == AMDGPU::IMPLICIT_DEF) + return; + else if (CurrCycleInstr->isDebugInstr()) + return; + unsigned NumWaitStates = TII.getNumWaitStates(*CurrCycleInstr); // Keep track of emitted instructions @@ -253,8 +261,7 @@ int GCNHazardRecognizer::getWaitStatesSince( return WaitStates; unsigned Opcode = MI->getOpcode(); - if (Opcode == AMDGPU::DBG_VALUE || Opcode == AMDGPU::IMPLICIT_DEF || - Opcode == AMDGPU::INLINEASM) + if (Opcode == AMDGPU::INLINEASM) continue; } ++WaitStates; |