Skip to content

Commit e655bd6

Browse files
committed
[AMDGPU] Fix register class constraints for si-fold-operands pass
Fixes #130020 This fixes an issue where the si-fold-operands pass would incorrectly fold immediate values into COPY instructions targeting av_32 registers, which is illegal. The pass now properly checks register class constraints before attempting to fold the immediates.
1 parent 547d52f commit e655bd6

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

llvm/test/CodeGen/AMDGPU/fold-imm-copy.mir

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ body: |
7474
7575
...
7676

77-
# GCN-LABEL: name: no_fold_imm_into_m0{{$}}
78-
# GCN: %0:sreg_32 = S_MOV_B32 -8
79-
# GCN-NEXT: $m0 = COPY %0
80-
8177
---
8278
name: no_fold_imm_into_m0
8379
tracksRegLiveness: true
@@ -93,8 +89,6 @@ body: |
9389
9490
...
9591

96-
# GCN-LABEL: name: fold_sgpr_imm_to_vgpr_copy{{$}}
97-
# GCN: $vgpr0 = V_MOV_B32_e32 -8, implicit $exec
9892
---
9993
name: fold_sgpr_imm_to_vgpr_copy
10094
tracksRegLiveness: true

0 commit comments

Comments
 (0)