-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[LiveVariables] Mark use as implicit-def if defined at instr #119446
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
Open
jofrn
wants to merge
12
commits into
llvm:main
Choose a base branch
from
jofrn:livevars-implicitdef
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6b852f9
[LiveVariables] Mark use as implicit-def if def is a subregister
jofrn 0208eb9
Rewrite loop to be modifiesRegister
jofrn e0cd95a
Add ll test
jofrn 1fa40b7
Rename test, use named value & declare hidden
jofrn ebc5d0c
Delete PartDefRegs part of HandlePhysRegUse
jofrn a44bb8d
Merge branch 'main' into livevars-implicitdef
jofrn 7b3266e
clang-format
jofrn a9d1662
Add tests and comments
jofrn 0ecabb7
Update test after rebase
jofrn 6669df1
Respond to comments
jofrn 5672eae
Added FindLastPartialDef back
jofrn 4ac7fce
Fix format and test
jofrn 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
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
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
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
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,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 -O1 %s -o - | FileCheck %s | ||
|
||
define amdgpu_ps <4 x float> @caller(ptr %ptr) { | ||
; CHECK-LABEL: caller: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: flat_load_dword v1, v[0:1] | ||
; CHECK-NEXT: s_mov_b32 s0, 0 | ||
; CHECK-NEXT: s_mov_b32 s1, 0 | ||
; CHECK-NEXT: s_mov_b32 s2, 0 | ||
; CHECK-NEXT: s_mov_b32 s5, fn@abs32@hi | ||
; CHECK-NEXT: s_mov_b32 s4, fn@abs32@lo | ||
; CHECK-NEXT: s_mov_b64 s[8:9], 0 | ||
; CHECK-NEXT: v_mov_b32_e32 v0, 0 | ||
; CHECK-NEXT: s_mov_b32 s3, 0 | ||
; CHECK-NEXT: v_mov_b32_e32 v2, 0 | ||
; CHECK-NEXT: s_mov_b32 s32, 0 | ||
; CHECK-NEXT: s_swappc_b64 s[30:31], s[4:5] | ||
; CHECK-NEXT: ; return to shader part epilog | ||
%L = load i32, ptr %ptr, align 4 | ||
%R = call <4 x float> @fn(<4 x i32> zeroinitializer, i32 0, i32 %L, i32 0) | ||
ret <4 x float> %R | ||
} | ||
|
||
declare hidden <4 x float> @fn(<4 x i32> inreg, i32, i32, i32) |
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,91 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple=amdgcn --run-pass=livevars -o - %s | FileCheck %s | ||
--- | ||
jofrn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Check that super register is defined for an sgpr copy. | ||
name: sgpr_copy | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
|
||
; CHECK-LABEL: name: sgpr_copy | ||
; CHECK: %sval:sreg_32 = S_MOV_B32 0 | ||
; CHECK-NEXT: $sgpr0 = COPY %sval | ||
; CHECK-NEXT: $sgpr1 = COPY %sval | ||
; CHECK-NEXT: $sgpr2 = COPY %sval | ||
; CHECK-NEXT: $sgpr3 = COPY killed %sval | ||
; CHECK-NEXT: SI_RETURN implicit killed $sgpr0_sgpr1_sgpr2_sgpr3 | ||
%sval:sreg_32 = S_MOV_B32 0 | ||
|
||
$sgpr0 = COPY %sval | ||
$sgpr1 = COPY %sval | ||
$sgpr2 = COPY %sval | ||
$sgpr3 = COPY %sval | ||
SI_RETURN implicit $sgpr0_sgpr1_sgpr2_sgpr3 | ||
|
||
... | ||
--- | ||
# Check that super register is defined for a vgpr vector copy. | ||
name: vgpr_copy | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
|
||
; CHECK-LABEL: name: vgpr_copy | ||
; CHECK: %vval:vgpr_32 = V_MOV_B32_e32 0, implicit $exec | ||
; CHECK-NEXT: $vgpr0 = COPY %vval | ||
; CHECK-NEXT: $vgpr1 = COPY %vval | ||
; CHECK-NEXT: $vgpr2 = COPY %vval | ||
; CHECK-NEXT: $vgpr3 = COPY killed %vval | ||
; CHECK-NEXT: dead [[COPY:%[0-9]+]]:vgpr_32 = COPY killed $vgpr0_vgpr1_vgpr2_vgpr3 | ||
%vval:vgpr_32 = V_MOV_B32_e32 0, implicit $exec | ||
|
||
$vgpr0 = COPY %vval | ||
$vgpr1 = COPY %vval | ||
$vgpr2 = COPY %vval | ||
$vgpr3 = COPY %vval | ||
%0:vgpr_32 = COPY $vgpr0_vgpr1_vgpr2_vgpr3 | ||
|
||
jofrn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
... | ||
--- | ||
# Check that super register is defined when there is a hole. | ||
name: sgpr_copy_hole | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: sgpr_copy_hole | ||
; CHECK: %sval:sreg_32 = S_MOV_B32 0 | ||
; CHECK-NEXT: $sgpr0 = COPY %sval | ||
; CHECK-NEXT: $sgpr2 = COPY %sval | ||
; CHECK-NEXT: $sgpr3 = COPY killed %sval | ||
; CHECK-NEXT: SI_RETURN implicit killed $sgpr0_sgpr1_sgpr2_sgpr3 | ||
%sval:sreg_32 = S_MOV_B32 0 | ||
|
||
$sgpr0 = COPY %sval | ||
$sgpr2 = COPY %sval | ||
$sgpr3 = COPY %sval | ||
SI_RETURN implicit $sgpr0_sgpr1_sgpr2_sgpr3 | ||
|
||
... | ||
--- | ||
# Check that super register is defined when a pair interrupts the sequence. | ||
name: vgpr_copy_pair | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: vgpr_copy_pair | ||
; CHECK: %vval:vgpr_32 = V_MOV_B32_e32 0, implicit $exec | ||
; CHECK-NEXT: $vgpr0 = COPY %vval | ||
; CHECK-NEXT: $vgpr1 = COPY %vval | ||
; CHECK-NEXT: $vgpr2 = COPY %vval | ||
; CHECK-NEXT: $vgpr3 = COPY killed %vval | ||
; CHECK-NEXT: dead [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr1_vgpr2 | ||
; CHECK-NEXT: dead [[COPY1:%[0-9]+]]:vgpr_32 = COPY killed $vgpr0_vgpr1_vgpr2_vgpr3 | ||
%vval:vgpr_32 = V_MOV_B32_e32 0, implicit $exec | ||
|
||
$vgpr0 = COPY %vval | ||
$vgpr1 = COPY %vval | ||
$vgpr2 = COPY %vval | ||
$vgpr3 = COPY %vval | ||
%0:vgpr_32 = COPY $vgpr1_vgpr2 | ||
%1:vgpr_32 = COPY $vgpr0_vgpr1_vgpr2_vgpr3 | ||
jofrn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
... |
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.