-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLVM][AArch64] Correctly lower funnel shifts by constants. #140058
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
4 commits
Select commit
Hold shift + click to select a range
8dd0065
[LLVM][DAGCombiner] Add command line option to disable the combiner.
paulwalker-arm 2bfdff8
[LLVM][AArch64] Correctly lower funnel shifts by constants.
paulwalker-arm fbad1e5
Ensure half element shifts are lowered correctly.
paulwalker-arm eba339d
Remove else.
paulwalker-arm 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc %s -o - | FileCheck %s | ||
; RUN: llc -combiner-disabled %s -o - | FileCheck %s | ||
|
||
target triple = "aarch64-unknown-linux-gnu" | ||
|
||
; Verify lowering code in isolation to ensure we can lower shifts that would | ||
; normally be optimised away. | ||
|
||
define i32 @fshl_i32_by_zero(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshl_i32_by_zero: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov w0, w1 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 0) | ||
ret i32 %r | ||
} | ||
|
||
define i32 @fshl_i32_by_half_srclen(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshl_i32_by_half_srclen: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: extr w0, w1, w2, #16 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 16) | ||
ret i32 %r | ||
} | ||
|
||
define i32 @fshl_i32_by_srclen(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshl_i32_by_srclen: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov w0, w1 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 32) | ||
ret i32 %r | ||
} | ||
|
||
define i32 @fshl_i32_by_srclen_plus1(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshl_i32_by_srclen_plus1: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: extr w0, w1, w2, #31 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshl.i32(i32 %a, i32 %b, i32 33) | ||
ret i32 %r | ||
} | ||
|
||
define i64 @fshl_i64_by_zero(i64 %unused, i64 %a, i64 %b) { | ||
; CHECK-LABEL: fshl_i64_by_zero: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov x0, x1 | ||
; CHECK-NEXT: ret | ||
%r = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 0) | ||
ret i64 %r | ||
} | ||
|
||
define i64 @fshl_i64_by_srclen(i64 %unused, i64 %a, i64 %b) { | ||
; CHECK-LABEL: fshl_i64_by_srclen: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov x0, x1 | ||
; CHECK-NEXT: ret | ||
%r = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 64) | ||
ret i64 %r | ||
} | ||
|
||
define i64 @fshl_i64_by_srclen_plus1(i64 %unused, i64 %a, i64 %b) { | ||
; CHECK-LABEL: fshl_i64_by_srclen_plus1: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: extr x0, x1, x2, #63 | ||
; CHECK-NEXT: ret | ||
%r = call i64 @llvm.fshl.i64(i64 %a, i64 %b, i64 65) | ||
ret i64 %r | ||
} | ||
|
||
define i32 @fshr_i32_by_zero(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshr_i32_by_zero: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov w0, w2 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshr.i32(i32 %a, i32 %b, i32 0) | ||
ret i32 %r | ||
} | ||
|
||
define i32 @fshr_i32_by_srclen(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshr_i32_by_srclen: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov w0, w2 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshr.i32(i32 %a, i32 %b, i32 32) | ||
ret i32 %r | ||
} | ||
|
||
define i32 @fshr_i32_by_half_srclen(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshr_i32_by_half_srclen: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: extr w0, w1, w2, #16 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshr.i32(i32 %a, i32 %b, i32 16) | ||
ret i32 %r | ||
} | ||
|
||
define i32 @fshr_i32_by_srclen_plus1(i32 %unused, i32 %a, i32 %b) { | ||
; CHECK-LABEL: fshr_i32_by_srclen_plus1: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: extr w0, w1, w2, #1 | ||
; CHECK-NEXT: ret | ||
%r = call i32 @llvm.fshr.i32(i32 %a, i32 %b, i32 33) | ||
ret i32 %r | ||
} | ||
|
||
define i64 @fshr_i64_by_zero(i64 %unused, i64 %a, i64 %b) { | ||
; CHECK-LABEL: fshr_i64_by_zero: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov x0, x2 | ||
; CHECK-NEXT: ret | ||
%r = call i64 @llvm.fshr.i64(i64 %a, i64 %b, i64 0) | ||
ret i64 %r | ||
} | ||
|
||
define i64 @fshr_i64_by_srclen(i64 %unused, i64 %a, i64 %b) { | ||
; CHECK-LABEL: fshr_i64_by_srclen: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: mov x0, x2 | ||
; CHECK-NEXT: ret | ||
%r = call i64 @llvm.fshr.i64(i64 %a, i64 %b, i64 64) | ||
ret i64 %r | ||
} | ||
|
||
define i64 @fshr_i64_by_srclen_plus1(i64 %unused, i64 %a, i64 %b) { | ||
; CHECK-LABEL: fshr_i64_by_srclen_plus1: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: extr x0, x1, x2, #1 | ||
; CHECK-NEXT: ret | ||
%r = call i64 @llvm.fshr.i64(i64 %a, i64 %b, i64 65) | ||
ret i64 %r | ||
} |
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.