-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[DAGISel][ARM] Fix vector truncate combine for big-endian #118101
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
6 commits
Select commit
Hold shift + click to select a range
7fb3d04
Add test showing bug
ostannard 700a905
[DAGISel][ARM] Fix vector truncate combine for big-endian
ostannard 804db3d
Remove unneeded target-features attribute
ostannard 97ad28d
Merge branch 'main' into neon-big-endian
ostannard fc2f59a
Also test little-endian
ostannard 3e7564b
Use existing isLE variable
ostannard 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -mtriple=armv7-unknown-none-eabihf -mattr=+neon < %s | FileCheck %s --check-prefix=LE | ||
| ; RUN: llc -mtriple=armebv7-unknown-none-eabihf -mattr=+neon < %s | FileCheck %s --check-prefix=BE | ||
|
|
||
| define i32 @test(i64 %arg1) { | ||
| ; LE-LABEL: test: | ||
| ; LE: @ %bb.0: @ %entry | ||
| ; LE-NEXT: subs r0, r0, #1 | ||
| ; LE-NEXT: mov r2, #0 | ||
| ; LE-NEXT: sbcs r0, r1, #0 | ||
| ; LE-NEXT: vldr s0, .LCPI0_0 | ||
| ; LE-NEXT: movwhs r2, #1 | ||
| ; LE-NEXT: cmp r2, #0 | ||
| ; LE-NEXT: mvnne r2, #0 | ||
| ; LE-NEXT: vmov s1, r2 | ||
| ; LE-NEXT: vmovn.i32 d16, q0 | ||
| ; LE-NEXT: vmovn.i16 d16, q8 | ||
| ; LE-NEXT: vmov.u8 r0, d16[0] | ||
| ; LE-NEXT: and r0, r0, #1 | ||
| ; LE-NEXT: bx lr | ||
| ; LE-NEXT: .p2align 2 | ||
| ; LE-NEXT: @ %bb.1: | ||
| ; LE-NEXT: .LCPI0_0: | ||
| ; LE-NEXT: .long 0xffffffff @ float NaN | ||
| ; | ||
| ; BE-LABEL: test: | ||
| ; BE: @ %bb.0: @ %entry | ||
| ; BE-NEXT: subs r1, r1, #1 | ||
| ; BE-NEXT: mov r2, #0 | ||
| ; BE-NEXT: sbcs r0, r0, #0 | ||
| ; BE-NEXT: vldr s0, .LCPI0_0 | ||
| ; BE-NEXT: movwhs r2, #1 | ||
| ; BE-NEXT: cmp r2, #0 | ||
| ; BE-NEXT: mvnne r2, #0 | ||
| ; BE-NEXT: vmov s1, r2 | ||
| ; BE-NEXT: vmovn.i32 d16, q0 | ||
| ; BE-NEXT: vmovn.i16 d16, q8 | ||
| ; BE-NEXT: vmov.u8 r0, d16[0] | ||
| ; BE-NEXT: and r0, r0, #1 | ||
| ; BE-NEXT: bx lr | ||
| ; BE-NEXT: .p2align 2 | ||
| ; BE-NEXT: @ %bb.1: | ||
| ; BE-NEXT: .LCPI0_0: | ||
| ; BE-NEXT: .long 0xffffffff @ float NaN | ||
| entry: | ||
| %insert_zero = insertelement <8 x i64> poison, i64 %arg1, i64 0 | ||
| %splat_zero = shufflevector <8 x i64> %insert_zero, <8 x i64> poison, <8 x i32> zeroinitializer | ||
| %cmp_vec = icmp ule <8 x i64> <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, %splat_zero | ||
| %first_cmp = extractelement <8 x i1> %cmp_vec, i32 0 | ||
| %ext = zext i1 %first_cmp to i32 | ||
| ret i32 %ext | ||
| } |
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.
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.
visitTRUNCATE already has isLE - replace this with: