-
Notifications
You must be signed in to change notification settings - Fork 14.3k
SystemZ: Fold copy of vector immediate to gr128 #90706
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 all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2ff4183
SystemZ: Add baseline test for peephole-opt immediate folding
arsenm c845cc4
SystemZ: Fold copy of vector immediate to gr128
arsenm cd8b2aa
Merge branch 'main' into systemz-fold-vector-imm-copy-to-gpr
arsenm 5f92f13
Only handle 0
arsenm 321f1a7
Formatting
arsenm 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
182 changes: 182 additions & 0 deletions
182
llvm/test/CodeGen/SystemZ/fold-copy-vector-immediate.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,182 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4 | ||
# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -run-pass=peephole-opt -o - %s | FileCheck %s | ||
|
||
--- | ||
name: fold_vgbm_0_copyvr128_to_gr128_virtreg | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: fold_vgbm_0_copyvr128_to_gr128_virtreg | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: [[LGHI:%[0-9]+]]:gr64bit = LGHI 0 | ||
; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:gr128bit = REG_SEQUENCE [[LGHI]], %subreg.subreg_h64, [[LGHI]], %subreg.subreg_l64 | ||
; CHECK-NEXT: $r0q = COPY [[REG_SEQUENCE]] | ||
; CHECK-NEXT: Return implicit $r0q | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
%3:gr128bit = COPY %2 | ||
$r0q = COPY %3 | ||
Return implicit $r0q | ||
... | ||
|
||
--- | ||
name: fold_vgbm_0_copyvr128_to_gr128_virtreg_multi_use | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: fold_vgbm_0_copyvr128_to_gr128_virtreg_multi_use | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr128bit = COPY [[VGBM]] | ||
; CHECK-NEXT: $r0q = COPY [[COPY2]] | ||
; CHECK-NEXT: $r2q = COPY [[COPY2]] | ||
; CHECK-NEXT: Return implicit $r0q, implicit $r2q | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
%3:gr128bit = COPY %2 | ||
%4:gr128bit = COPY %2 | ||
$r0q = COPY %3 | ||
$r2q = COPY %4 | ||
Return implicit $r0q, implicit $r2q | ||
... | ||
|
||
--- | ||
name: fold_vgbm_0_copyvr128_to_gr128_physreg | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: fold_vgbm_0_copyvr128_to_gr128_physreg | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: $r0q = COPY [[VGBM]] | ||
; CHECK-NEXT: Return implicit $r0q | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
$r0q = COPY %2 | ||
Return implicit $r0q | ||
... | ||
|
||
--- | ||
name: no_fold_vgbm_0_copyvr128_to_vr128_virtreg | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: no_fold_vgbm_0_copyvr128_to_vr128_virtreg | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr128bit = COPY [[VGBM]] | ||
; CHECK-NEXT: $v0 = COPY [[COPY2]] | ||
; CHECK-NEXT: Return implicit $v0 | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
%3:vr128bit = COPY %2 | ||
$v0 = COPY %3 | ||
Return implicit $v0 | ||
... | ||
|
||
--- | ||
name: no_fold_vgbm_0_copyvr128_to_vr128_physreg | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: no_fold_vgbm_0_copyvr128_to_vr128_physreg | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: $v0 = COPY [[VGBM]] | ||
; CHECK-NEXT: Return implicit $v0 | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
$v0 = COPY %2 | ||
Return implicit $v0 | ||
... | ||
|
||
--- | ||
name: fold_vgbm_1_copyvr128_to_gr128_virtreg | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: fold_vgbm_1_copyvr128_to_gr128_virtreg | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 1 | ||
; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr128bit = COPY [[VGBM]] | ||
; CHECK-NEXT: $r0q = COPY [[COPY2]] | ||
; CHECK-NEXT: Return implicit $r0q | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 1 | ||
arsenm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%3:gr128bit = COPY %2 | ||
$r0q = COPY %3 | ||
Return implicit $r0q | ||
... | ||
|
||
--- | ||
name: no_fold_vgbm_0_noncopy_use | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: no_fold_vgbm_0_noncopy_use | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: Return implicit [[VGBM]] | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
Return implicit %2 | ||
... | ||
|
||
--- | ||
name: fold_vgbm_0_copyvr128_to_gr64_subreg_h64 | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $r2d | ||
; CHECK-LABEL: name: fold_vgbm_0_copyvr128_to_gr64_subreg_h64 | ||
; CHECK: liveins: $r2d | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64bit = COPY $r2d | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:addr64bit = COPY [[COPY]] | ||
; CHECK-NEXT: [[VGBM:%[0-9]+]]:vr128bit = VGBM 0 | ||
; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr64bit = COPY [[VGBM]].subreg_h64 | ||
; CHECK-NEXT: $r0d = COPY [[COPY2]] | ||
; CHECK-NEXT: Return implicit $r0d | ||
%0:gr64bit = COPY $r2d | ||
%1:addr64bit = COPY %0 | ||
%2:vr128bit = VGBM 0 | ||
%3:gr64bit = COPY %2.subreg_h64 | ||
$r0d = COPY %3 | ||
Return implicit $r0d | ||
... |
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.