Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC] Extend folding RLWINM + RLWINM to post-RA.
Summary: This patch depends on D89846. We have the patterns to fold 2 RLWINMs in ppc-mi-peephole, while some RLWINM will be generated after RA, for example rGc4690b007743. If the RLWINM generated after RA followed by another RLWINM, we expect to perform the optimization after RA, too. Reviewed By: shchenz, steven.zhang Differential Revision: https://reviews.llvm.org/D89855
- Loading branch information
Showing
7 changed files
with
174 additions
and
26 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
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
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,104 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown -stop-after \ | ||
# RUN: ppc-pre-emit-peephole %s -o - | FileCheck %s | ||
|
||
--- | ||
name: testFoldRLWINM | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINM | ||
; CHECK: liveins: $r3 | ||
; CHECK: renamable $r3 = RLWINM killed renamable $r3, 14, 0, 12, implicit-def $x3 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
$r3 = RLWINM killed $r3, 27, 5, 31 | ||
dead renamable $r3 = RLWINM killed renamable $r3, 19, 0, 12, implicit-def $x3 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
... | ||
--- | ||
name: testFoldRLWINMSrcFullMask | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINMSrcFullMask | ||
; CHECK: liveins: $r3 | ||
; CHECK: renamable $r3 = RLWINM killed renamable $r3, 14, 0, 12, implicit-def $x3 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
$r3 = RLWINM killed $r3, 27, 0, 31 | ||
dead renamable $r3 = RLWINM killed renamable $r3, 19, 0, 12, implicit-def $x3 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
... | ||
--- | ||
name: testFoldRLWINMSrcWrapped | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINMSrcWrapped | ||
; CHECK: liveins: $r3 | ||
; CHECK: renamable $r3 = RLWINM killed renamable $r3, 14, 11, 12, implicit-def $x3 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
$r3 = RLWINM killed $r3, 27, 30, 10 | ||
dead renamable $r3 = RLWINM killed renamable $r3, 19, 0, 12, implicit-def $x3 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
... | ||
--- | ||
name: testFoldRLWINMToZero | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINMToZero | ||
; CHECK: liveins: $r3 | ||
; CHECK: renamable $r3 = LI 0, implicit-def $x3 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
$r3 = RLWINM killed $r3, 27, 5, 10 | ||
dead renamable $r3 = RLWINM killed renamable $r3, 8, 5, 10, implicit-def $x3 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
... | ||
--- | ||
name: testFoldRLWINM_recToZero | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINM_recToZero | ||
; CHECK: liveins: $r3 | ||
; CHECK: dead renamable $r3 = ANDI_rec killed renamable $r3, 0, implicit-def $cr0 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $cr0 | ||
$r3 = RLWINM killed $r3, 27, 5, 10 | ||
dead renamable $r3 = RLWINM_rec killed renamable $r3, 8, 5, 10, implicit-def $cr0 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $cr0 | ||
... | ||
--- | ||
name: testFoldRLWINMoToZeroSrcCanNotBeDeleted | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINMoToZeroSrcCanNotBeDeleted | ||
; CHECK: liveins: $r3 | ||
; CHECK: $r3 = RLWINM_rec $r3, 27, 5, 10, implicit-def dead $cr0 | ||
; CHECK: dead renamable $r3 = ANDI_rec killed renamable $r3, 0, implicit-def $cr0 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $cr0 | ||
$r3 = RLWINM_rec $r3, 27, 5, 10, implicit-def $cr0 | ||
dead renamable $r3 = RLWINM_rec killed renamable $r3, 8, 5, 10, implicit-def $cr0 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $cr0 | ||
... | ||
--- | ||
name: testFoldRLWINMInvalidMask | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $r3 | ||
; CHECK-LABEL: name: testFoldRLWINMInvalidMask | ||
; CHECK: liveins: $r3 | ||
; CHECK: $r3 = RLWINM killed $r3, 20, 5, 31 | ||
; CHECK: renamable $r3 = RLWINM killed renamable $r3, 19, 10, 20, implicit-def $x3 | ||
; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
$r3 = RLWINM killed $r3, 20, 5, 31 | ||
dead renamable $r3 = RLWINM killed renamable $r3, 19, 10, 20, implicit-def $x3 | ||
BLR8 implicit $lr8, implicit $rm, implicit killed $x3 | ||
... |
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
119ab21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit caused stage2 LIT failures on bots ppc64le-lld-multistage and ppc64le-clang-multistage-test :