-
Notifications
You must be signed in to change notification settings - Fork 15k
[AArch64][SVE2p1] Allow more uses of mask in performActiveLaneMaskCombine #159360
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
7 commits
Select commit
Hold shift + click to select a range
7f042ec
- Tests for get_active_lane_mask with more uses than extract_vector
kmclaughlin-arm 64b6d61
[AArch64][SVE2p1] Allow more uses of mask in performActiveLaneMaskCom…
kmclaughlin-arm 70adaf7
- Return a concat_vector created from the results of whilelo_x2 from …
kmclaughlin-arm 083701d
- Fix !!DCI.isBeforeLegalizeOps -> !DCI.isBeforeLegalizeOps
kmclaughlin-arm d64e2d8
- Remove !DCI.isBeforeLegalizeOps
kmclaughlin-arm c077d34
- Moved zero check into isKnownMultipleOf & added test to TypeSizeTes…
kmclaughlin-arm a815152
- Fix comment in performActiveLaneMaskCombine
kmclaughlin-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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
|
|
@@ -310,6 +310,187 @@ define void @test_2x32bit_mask_with_32bit_index_and_trip_count(i32 %i, i32 %n) # | |
| ret void | ||
| } | ||
|
|
||
| ; Extra use of the get_active_lane_mask from an extractelement, which is replaced with ptest_first. | ||
|
|
||
| define void @test_2x8bit_mask_with_extracts_and_ptest(i64 %i, i64 %n) { | ||
| ; CHECK-SVE-LABEL: test_2x8bit_mask_with_extracts_and_ptest: | ||
| ; CHECK-SVE: // %bb.0: // %entry | ||
| ; CHECK-SVE-NEXT: whilelo p1.b, x0, x1 | ||
| ; CHECK-SVE-NEXT: b.pl .LBB11_2 | ||
| ; CHECK-SVE-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE-NEXT: punpklo p0.h, p1.b | ||
| ; CHECK-SVE-NEXT: punpkhi p1.h, p1.b | ||
| ; CHECK-SVE-NEXT: b use | ||
| ; CHECK-SVE-NEXT: .LBB11_2: // %if.end | ||
| ; CHECK-SVE-NEXT: ret | ||
| ; | ||
| ; CHECK-SVE2p1-SME2-LABEL: test_2x8bit_mask_with_extracts_and_ptest: | ||
| ; CHECK-SVE2p1-SME2: // %bb.0: // %entry | ||
| ; CHECK-SVE2p1-SME2-NEXT: whilelo { p0.h, p1.h }, x0, x1 | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptrue p2.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p3.b, p0.b, p1.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptest p2, p3.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: b.pl .LBB11_2 | ||
| ; CHECK-SVE2p1-SME2-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE2p1-SME2-NEXT: b use | ||
| ; CHECK-SVE2p1-SME2-NEXT: .LBB11_2: // %if.end | ||
| ; CHECK-SVE2p1-SME2-NEXT: ret | ||
| entry: | ||
| %r = call <vscale x 16 x i1> @llvm.get.active.lane.mask.nxv16i1.i32(i64 %i, i64 %n) | ||
| %v0 = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv16i1.i64(<vscale x 16 x i1> %r, i64 0) | ||
| %v1 = call <vscale x 8 x i1> @llvm.vector.extract.nxv8i1.nxv16i1.i64(<vscale x 16 x i1> %r, i64 8) | ||
| %elt0 = extractelement <vscale x 16 x i1> %r, i32 0 | ||
| br i1 %elt0, label %if.then, label %if.end | ||
|
|
||
| if.then: | ||
| tail call void @use(<vscale x 8 x i1> %v0, <vscale x 8 x i1> %v1) | ||
| br label %if.end | ||
|
|
||
| if.end: | ||
| ret void | ||
| } | ||
|
|
||
| ; Extra use of the get_active_lane_mask from an extractelement, which is | ||
| ; replaced with ptest_first and reinterpret_casts because the extract is not nxv16i1. | ||
|
|
||
| define void @test_2x8bit_mask_with_extracts_and_reinterpret_casts(i64 %i, i64 %n) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's worth adding a similar test for the |
||
| ; CHECK-SVE-LABEL: test_2x8bit_mask_with_extracts_and_reinterpret_casts: | ||
| ; CHECK-SVE: // %bb.0: // %entry | ||
| ; CHECK-SVE-NEXT: whilelo p1.h, x0, x1 | ||
| ; CHECK-SVE-NEXT: b.pl .LBB12_2 | ||
| ; CHECK-SVE-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE-NEXT: punpklo p0.h, p1.b | ||
| ; CHECK-SVE-NEXT: punpkhi p1.h, p1.b | ||
| ; CHECK-SVE-NEXT: b use | ||
| ; CHECK-SVE-NEXT: .LBB12_2: // %if.end | ||
| ; CHECK-SVE-NEXT: ret | ||
| ; | ||
| ; CHECK-SVE2p1-SME2-LABEL: test_2x8bit_mask_with_extracts_and_reinterpret_casts: | ||
| ; CHECK-SVE2p1-SME2: // %bb.0: // %entry | ||
| ; CHECK-SVE2p1-SME2-NEXT: whilelo { p0.s, p1.s }, x0, x1 | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptrue p2.h | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p3.h, p0.h, p1.h | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptest p2, p3.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: b.pl .LBB12_2 | ||
| ; CHECK-SVE2p1-SME2-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE2p1-SME2-NEXT: b use | ||
| ; CHECK-SVE2p1-SME2-NEXT: .LBB12_2: // %if.end | ||
| ; CHECK-SVE2p1-SME2-NEXT: ret | ||
| entry: | ||
| %r = call <vscale x 8 x i1> @llvm.get.active.lane.mask.nxv8i1.i64(i64 %i, i64 %n) | ||
| %v0 = tail call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv8i1(<vscale x 8 x i1> %r, i64 0) | ||
| %v1 = tail call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv8i1(<vscale x 8 x i1> %r, i64 4) | ||
| %elt0 = extractelement <vscale x 8 x i1> %r, i64 0 | ||
| br i1 %elt0, label %if.then, label %if.end | ||
|
|
||
| if.then: | ||
| tail call void @use(<vscale x 4 x i1> %v0, <vscale x 4 x i1> %v1) | ||
| br label %if.end | ||
|
|
||
| if.end: | ||
| ret void | ||
| } | ||
|
|
||
| define void @test_4x4bit_mask_with_extracts_and_ptest(i64 %i, i64 %n) { | ||
| ; CHECK-SVE-LABEL: test_4x4bit_mask_with_extracts_and_ptest: | ||
| ; CHECK-SVE: // %bb.0: // %entry | ||
| ; CHECK-SVE-NEXT: whilelo p0.b, x0, x1 | ||
| ; CHECK-SVE-NEXT: b.pl .LBB13_2 | ||
| ; CHECK-SVE-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE-NEXT: punpklo p1.h, p0.b | ||
| ; CHECK-SVE-NEXT: punpkhi p3.h, p0.b | ||
| ; CHECK-SVE-NEXT: punpklo p0.h, p1.b | ||
| ; CHECK-SVE-NEXT: punpkhi p1.h, p1.b | ||
| ; CHECK-SVE-NEXT: punpklo p2.h, p3.b | ||
| ; CHECK-SVE-NEXT: punpkhi p3.h, p3.b | ||
| ; CHECK-SVE-NEXT: b use | ||
| ; CHECK-SVE-NEXT: .LBB13_2: // %if.end | ||
| ; CHECK-SVE-NEXT: ret | ||
| ; | ||
| ; CHECK-SVE2p1-SME2-LABEL: test_4x4bit_mask_with_extracts_and_ptest: | ||
| ; CHECK-SVE2p1-SME2: // %bb.0: // %entry | ||
| ; CHECK-SVE2p1-SME2-NEXT: cnth x8 | ||
| ; CHECK-SVE2p1-SME2-NEXT: adds x8, x0, x8 | ||
| ; CHECK-SVE2p1-SME2-NEXT: csinv x8, x8, xzr, lo | ||
| ; CHECK-SVE2p1-SME2-NEXT: whilelo { p0.s, p1.s }, x0, x1 | ||
| ; CHECK-SVE2p1-SME2-NEXT: whilelo { p2.s, p3.s }, x8, x1 | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p4.h, p0.h, p1.h | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p5.h, p2.h, p3.h | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p4.b, p4.b, p5.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptrue p5.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptest p5, p4.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: b.pl .LBB13_2 | ||
| ; CHECK-SVE2p1-SME2-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE2p1-SME2-NEXT: b use | ||
| ; CHECK-SVE2p1-SME2-NEXT: .LBB13_2: // %if.end | ||
| ; CHECK-SVE2p1-SME2-NEXT: ret | ||
| entry: | ||
| %r = call <vscale x 16 x i1> @llvm.get.active.lane.mask.nxv16i1.i32(i64 %i, i64 %n) | ||
| %v0 = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1.i64(<vscale x 16 x i1> %r, i64 0) | ||
| %v1 = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1.i64(<vscale x 16 x i1> %r, i64 4) | ||
| %v2 = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1.i64(<vscale x 16 x i1> %r, i64 8) | ||
| %v3 = call <vscale x 4 x i1> @llvm.vector.extract.nxv4i1.nxv16i1.i64(<vscale x 16 x i1> %r, i64 12) | ||
| %elt0 = extractelement <vscale x 16 x i1> %r, i32 0 | ||
| br i1 %elt0, label %if.then, label %if.end | ||
|
|
||
| if.then: | ||
| tail call void @use(<vscale x 4 x i1> %v0, <vscale x 4 x i1> %v1, <vscale x 4 x i1> %v2, <vscale x 4 x i1> %v3) | ||
| br label %if.end | ||
|
|
||
| if.end: | ||
| ret void | ||
| } | ||
|
|
||
| define void @test_4x2bit_mask_with_extracts_and_reinterpret_casts(i64 %i, i64 %n) { | ||
| ; CHECK-SVE-LABEL: test_4x2bit_mask_with_extracts_and_reinterpret_casts: | ||
| ; CHECK-SVE: // %bb.0: // %entry | ||
| ; CHECK-SVE-NEXT: whilelo p0.h, x0, x1 | ||
| ; CHECK-SVE-NEXT: b.pl .LBB14_2 | ||
| ; CHECK-SVE-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE-NEXT: punpklo p1.h, p0.b | ||
| ; CHECK-SVE-NEXT: punpkhi p3.h, p0.b | ||
| ; CHECK-SVE-NEXT: punpklo p0.h, p1.b | ||
| ; CHECK-SVE-NEXT: punpkhi p1.h, p1.b | ||
| ; CHECK-SVE-NEXT: punpklo p2.h, p3.b | ||
| ; CHECK-SVE-NEXT: punpkhi p3.h, p3.b | ||
| ; CHECK-SVE-NEXT: b use | ||
| ; CHECK-SVE-NEXT: .LBB14_2: // %if.end | ||
| ; CHECK-SVE-NEXT: ret | ||
| ; | ||
| ; CHECK-SVE2p1-SME2-LABEL: test_4x2bit_mask_with_extracts_and_reinterpret_casts: | ||
| ; CHECK-SVE2p1-SME2: // %bb.0: // %entry | ||
| ; CHECK-SVE2p1-SME2-NEXT: cntw x8 | ||
| ; CHECK-SVE2p1-SME2-NEXT: adds x8, x0, x8 | ||
| ; CHECK-SVE2p1-SME2-NEXT: csinv x8, x8, xzr, lo | ||
| ; CHECK-SVE2p1-SME2-NEXT: whilelo { p0.d, p1.d }, x0, x1 | ||
| ; CHECK-SVE2p1-SME2-NEXT: whilelo { p2.d, p3.d }, x8, x1 | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p4.s, p0.s, p1.s | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p5.s, p2.s, p3.s | ||
| ; CHECK-SVE2p1-SME2-NEXT: uzp1 p4.h, p4.h, p5.h | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptrue p5.h | ||
| ; CHECK-SVE2p1-SME2-NEXT: ptest p5, p4.b | ||
| ; CHECK-SVE2p1-SME2-NEXT: b.pl .LBB14_2 | ||
| ; CHECK-SVE2p1-SME2-NEXT: // %bb.1: // %if.then | ||
| ; CHECK-SVE2p1-SME2-NEXT: b use | ||
| ; CHECK-SVE2p1-SME2-NEXT: .LBB14_2: // %if.end | ||
| ; CHECK-SVE2p1-SME2-NEXT: ret | ||
| entry: | ||
| %r = call <vscale x 8 x i1> @llvm.get.active.lane.mask.nxv8i1.i32(i64 %i, i64 %n) | ||
| %v0 = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv8i1.i64(<vscale x 8 x i1> %r, i64 0) | ||
| %v1 = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv8i1.i64(<vscale x 8 x i1> %r, i64 2) | ||
| %v2 = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv8i1.i64(<vscale x 8 x i1> %r, i64 4) | ||
| %v3 = call <vscale x 2 x i1> @llvm.vector.extract.nxv2i1.nxv8i1.i64(<vscale x 8 x i1> %r, i64 6) | ||
| %elt0 = extractelement <vscale x 8 x i1> %r, i32 0 | ||
| br i1 %elt0, label %if.then, label %if.end | ||
|
|
||
| if.then: | ||
| tail call void @use(<vscale x 2 x i1> %v0, <vscale x 2 x i1> %v1, <vscale x 2 x i1> %v2, <vscale x 2 x i1> %v3) | ||
| br label %if.end | ||
|
|
||
| if.end: | ||
| ret void | ||
| } | ||
|
|
||
| declare void @use(...) | ||
|
|
||
| attributes #0 = { nounwind } | ||
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
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.