diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:01:25 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:01:25 +0000 |
commit | d8e91e46262bc44006913e6796843909f1ac7bcd (patch) | |
tree | 7d0c143d9b38190e0fa0180805389da22cd834c5 /lib/Target/AMDGPU/GCNHazardRecognizer.cpp | |
parent | b7eb8e35e481a74962664b63dfb09483b200209a (diff) |
Notes
Diffstat (limited to 'lib/Target/AMDGPU/GCNHazardRecognizer.cpp')
-rw-r--r-- | lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/lib/Target/AMDGPU/GCNHazardRecognizer.cpp index f236f10ba75a..c6396de89c4f 100644 --- a/lib/Target/AMDGPU/GCNHazardRecognizer.cpp +++ b/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; |