-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[CodeGen] Register-coalescer remat fix subreg liveness #165662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
64bbd4b
[CodeGen] Register-coalescer remat fix subreg liveness
VigneshwarJ 54060b3
fix tests
VigneshwarJ 74bdb76
review comments
VigneshwarJ 4df78bb
updated tests
VigneshwarJ 8e64e71
changed to refineSubrange
VigneshwarJ 6ef4f65
added one more test
VigneshwarJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
78 changes: 78 additions & 0 deletions
78
llvm/test/CodeGen/AMDGPU/reg-coalescer-subreg-liveness.mir
This file contains hidden or 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,78 @@ | ||
| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6 | ||
| # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -run-pass=register-coalescer -verify-coalescing -o - %s | FileCheck %s | ||
|
|
||
| # This test is to check fix for failure with "Bad machine code: Defining instruction does not modify register" due to corrupt lane mask. | ||
|
|
||
| --- | ||
| name: reg_coalescer_subreg_liveness | ||
| tracksRegLiveness: true | ||
| liveins: | ||
| body: | | ||
| ; CHECK-LABEL: name: reg_coalescer_subreg_liveness | ||
| ; CHECK: bb.0: | ||
| ; CHECK-NEXT: successors: %bb.1(0x80000000) | ||
| ; CHECK-NEXT: liveins: $sgpr4_sgpr5 | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5 | ||
| ; CHECK-NEXT: undef [[S_LOAD_DWORD_IMM:%[0-9]+]].sub1:sgpr_128 = S_LOAD_DWORD_IMM [[COPY]], 0, 0 :: (dereferenceable invariant load (s32), align 16, addrspace 4) | ||
| ; CHECK-NEXT: undef [[S_MOV_B32_:%[0-9]+]].sub0:sgpr_128 = S_MOV_B32 1 | ||
| ; CHECK-NEXT: undef [[S_MOV_B32_1:%[0-9]+]].sub0:sgpr_256 = S_MOV_B32 0 | ||
| ; CHECK-NEXT: TENSOR_LOAD_TO_LDS_D2 [[S_MOV_B32_]], [[S_MOV_B32_1]], 0, 0, implicit-def dead $tensorcnt, implicit $exec, implicit $tensorcnt | ||
| ; CHECK-NEXT: [[S_LOAD_DWORD_IMM:%[0-9]+]].sub0:sgpr_128 = S_MOV_B32 1 | ||
| ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub1:sgpr_128 = COPY [[S_MOV_B32_]].sub0 | ||
| ; CHECK-NEXT: [[S_LOAD_DWORD_IMM:%[0-9]+]].sub2:sgpr_128 = S_MOV_B32 0 | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: bb.1: | ||
| ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000) | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub2:sgpr_128 = COPY [[S_MOV_B32_]].sub0 | ||
| ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub3:sgpr_128 = COPY [[S_MOV_B32_]].sub0 | ||
| ; CHECK-NEXT: TENSOR_LOAD_TO_LDS_D2 [[S_MOV_B32_]], [[S_MOV_B32_1]], 0, 0, implicit-def dead $tensorcnt, implicit $exec, implicit $tensorcnt | ||
| ; CHECK-NEXT: TENSOR_LOAD_TO_LDS_D2 [[S_LOAD_DWORD_IMM]], [[S_MOV_B32_1]], 0, 0, implicit-def dead $tensorcnt, implicit $exec, implicit $tensorcnt | ||
| ; CHECK-NEXT: $vcc_lo = COPY $exec_lo | ||
| ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]].sub1:sgpr_128 = S_MOV_B32 0 | ||
| ; CHECK-NEXT: [[S_LOAD_DWORD_IMM:%[0-9]+]].sub2:sgpr_128 = S_MOV_B32 1 | ||
| ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit killed $vcc_lo, implicit $vcc_lo, implicit $vcc_lo | ||
| ; CHECK-NEXT: S_BRANCH %bb.2 | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: bb.2: | ||
| ; CHECK-NEXT: S_ENDPGM 0 | ||
| bb.0: | ||
| successors: %bb.1(0x80000000) | ||
| liveins: $sgpr4_sgpr5 | ||
|
|
||
| %0:sgpr_64 = COPY killed $sgpr4_sgpr5 | ||
| %1:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM killed %0, 0, 0 :: (dereferenceable invariant load (s32), align 16, addrspace 4) | ||
| %2:sreg_32 = S_MOV_B32 1 | ||
| undef %3.sub0:sgpr_128 = COPY %2 | ||
| %4:sreg_32 = S_MOV_B32 0 | ||
| undef %5.sub0:sgpr_256 = COPY %4 | ||
| TENSOR_LOAD_TO_LDS_D2 %3, %5, 0, 0, implicit-def dead $tensorcnt, implicit $exec, implicit $tensorcnt | ||
| %6:sgpr_128 = COPY killed %3 | ||
| %6.sub1:sgpr_128 = COPY killed %1 | ||
| %7:sreg_32 = COPY $exec_lo | ||
| %8:sreg_32 = COPY %2 | ||
| %9:sreg_32 = COPY %4 | ||
|
|
||
| bb.1: | ||
| successors: %bb.1(0x40000000), %bb.2(0x40000000) | ||
|
|
||
| %10:sreg_32 = COPY killed %8 | ||
| undef %11.sub0:sgpr_128 = COPY %2 | ||
| %11.sub1:sgpr_128 = COPY killed %10 | ||
| %11.sub2:sgpr_128 = COPY %2 | ||
| %11.sub3:sgpr_128 = COPY %2 | ||
| TENSOR_LOAD_TO_LDS_D2 killed %11, %5, 0, 0, implicit-def dead $tensorcnt, implicit $exec, implicit $tensorcnt | ||
| %12:sreg_32 = COPY killed %9 | ||
| %13:sgpr_128 = COPY %6 | ||
| %13.sub2:sgpr_128 = COPY killed %12 | ||
| TENSOR_LOAD_TO_LDS_D2 killed %13, %5, 0, 0, implicit-def dead $tensorcnt, implicit $exec, implicit $tensorcnt | ||
| $vcc_lo = COPY %7 | ||
| %8:sreg_32 = COPY %4 | ||
| %9:sreg_32 = COPY %2 | ||
| S_CBRANCH_VCCNZ %bb.1, implicit killed $vcc_lo, implicit $vcc_lo, implicit $vcc | ||
| S_BRANCH %bb.2 | ||
|
|
||
| bb.2: | ||
| S_ENDPGM 0 | ||
| ... |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.