Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AMDGPU] fix copies between 32 and 16 bit
This a hack to fix illegal 32 to 16 bit copies. The problem is when we make 16 bit subregs legal it creates a huge amount of failures which can only be resolved at once without a temporary hack like this. The next step is to change operands, instruction definitions and patterns until this hack is not needed. Differential Revision: https://reviews.llvm.org/D79119
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass postrapseudos -amdgpu-fix-16-bit-physreg-copies -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s | ||
|
||
# GCN-LABEL: name: lo16_to_v32 | ||
# GCN: $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec | ||
name: lo16_to_v32 | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
$vgpr0 = IMPLICIT_DEF | ||
$vgpr1_lo16 = COPY $vgpr0 | ||
S_ENDPGM 0 | ||
... | ||
|
||
# GCN-LABEL: name: v32_to_lo16 | ||
# GCN: $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec | ||
name: v32_to_lo16 | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
$vgpr0 = IMPLICIT_DEF | ||
$vgpr1 = COPY $vgpr0_lo16 | ||
S_ENDPGM 0 | ||
... | ||
|
||
# GCN-LABEL: name: samereg | ||
# GCN: $vgpr0 = IMPLICIT_DEF | ||
# GCN-NEXT: BUNDLE | ||
# GCN-NEXT: S_ENDPGM | ||
name: samereg | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
$vgpr0 = IMPLICIT_DEF | ||
$vgpr0 = COPY $vgpr0_lo16 | ||
S_ENDPGM 0 | ||
... |