Skip to content

Commit 8f45184

Browse files
Pravin JagtapPravin Jagtap
authored andcommitted
[AMDGPU] Machine-CP is deleting incorrect copy instr.
During AGPR tuple SPILLing, AMDGPU backend marks the tuple as implicit-def in the first spill instruction. It clobbers the register and the machine-cp thinks its def i.e. copy is deletable which I think is incorrect. Seeking help to understand whether following copy is deletable here ? (given the fact that compiler decided to mark it implicit-def for preserving the liveness) renamable $agpr1 = COPY renamable $agpr3, implicit $exec
1 parent f1888e4 commit 8f45184

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2+
# RUN: llc -mtriple=amdgcn -mcpu=gfx908 %s -o - -run-pass machine-cp -verify-machineinstrs | FileCheck -check-prefix=GFX908 %s
3+
4+
---
5+
name: foo
6+
tracksRegLiveness: true
7+
body: |
8+
bb.0:
9+
successors:
10+
liveins: $vgpr0, $agpr3
11+
12+
; GFX908-LABEL: name: foo
13+
; GFX908: liveins: $vgpr0, $agpr3
14+
; GFX908-NEXT: {{ $}}
15+
; GFX908-NEXT: renamable $agpr0 = COPY renamable $vgpr0, implicit $exec
16+
; GFX908-NEXT: $vgpr254 = V_ACCVGPR_READ_B32_e64 $agpr0, implicit $exec, implicit-def $agpr0_agpr1
17+
; GFX908-NEXT: $vgpr255 = V_ACCVGPR_READ_B32_e64 $agpr1, implicit $exec
18+
; GFX908-NEXT: S_ENDPGM 0
19+
renamable $agpr0 = COPY renamable $vgpr0, implicit $exec
20+
renamable $agpr1 = COPY renamable $agpr3, implicit $exec
21+
$vgpr254 = V_ACCVGPR_READ_B32_e64 $agpr0, implicit $exec, implicit-def $agpr0_agpr1
22+
$vgpr255 = V_ACCVGPR_READ_B32_e64 $agpr1, implicit $exec
23+
S_ENDPGM 0
24+
...

0 commit comments

Comments
 (0)