llvm.org GIT mirror llvm / 624049e
[AMDGPU] Omit KILL instructions from hazard recognizer Summary: In some cases the KILL was causing a hazard to be introduced as these were scheduled into hazard slots, but don't result in an instruction. KILL shouldn't be considered for hazard recognition. Change-Id: Ib6d2a2160f8c94cd0ce611ab198c7e4f46aeffcf Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58898 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355384 91177308-0d34-0410-b5e6-96231b3b80d8 David Stuttard 7 months ago
2 changed file(s) with 34 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
240240 // Do not track non-instructions which do not affect the wait states.
241241 // If included, these instructions can lead to buffer overflow such that
242242 // detectable hazards are missed.
243 if (CurrCycleInstr->isImplicitDef())
244 return;
245 else if (CurrCycleInstr->isDebugInstr())
243 if (CurrCycleInstr->isImplicitDef() || CurrCycleInstr->isDebugInstr() ||
244 CurrCycleInstr->isKill())
246245 return;
247246
248247 unsigned NumWaitStates = TII.getNumWaitStates(*CurrCycleInstr);
0 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass post-RA-sched %s -o - | FileCheck -check-prefix=GFX90 %s
1
2 # This tests that a KILL isn't considered as a valid instruction for a hazard
3 # slot (e.g. m0 def followed by V_INTERP for gfx9)
4 # The hazard recognizer should mov another instruction into that slot (in this case the S_MOV_B32
5
6 --- |
7 define amdgpu_ps void @_amdgpu_ps_main() #0 { ret void }
8 ...
9 ---
10 # CHECK-LABEL: name: _amdgpu_ps_main
11 # CHECK-LABEL: bb.0:
12 # GFX90: $m0 = S_MOV_B32 killed renamable $sgpr4
13 # GFX90-NEXT: KILL undef renamable $sgpr2
14 # GFX90-NEXT: S_MOV_B32 0
15 # GFX90-NEXT: V_INTERP_MOV_F32
16 name: _amdgpu_ps_main
17 tracksRegLiveness: true
18 body: |
19 bb.0:
20 liveins: $sgpr2, $sgpr3, $sgpr4
21
22 $sgpr6 = S_MOV_B32 killed $sgpr3
23 renamable $sgpr8_sgpr9_sgpr10_sgpr11 = S_LOAD_DWORDX4_IMM renamable $sgpr6_sgpr7, 16, 0
24 $m0 = S_MOV_B32 killed renamable $sgpr4
25 dead renamable $sgpr0 = KILL undef renamable $sgpr2
26 renamable $vgpr0 = V_INTERP_MOV_F32 2, 0, 0, implicit $m0, implicit $exec
27 renamable $sgpr0 = S_MOV_B32 0
28
29 S_ENDPGM
30
31 ...