-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[DAGCombiner] Fix assertion failure in vector division lowering #172321
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
Open
SavchenkoValeriy
wants to merge
1
commit into
llvm:main
Choose a base branch
from
SavchenkoValeriy:fix/div-lowering-illegal-type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
79 changes: 79 additions & 0 deletions
79
llvm/test/CodeGen/AArch64/vector-div-by-promoted-const-no-assertion.ll
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,79 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc < %s | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32" | ||
| target triple = "aarch64-pc-windows-msvc" | ||
SavchenkoValeriy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| define <16 x i16> @udiv_v16i16_from_zext(<16 x i8> %x) { | ||
| ; CHECK-LABEL: udiv_v16i16_from_zext: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: mov w8, #21846 // =0x5556 | ||
| ; CHECK-NEXT: ushll2 v1.8h, v0.16b, #0 | ||
| ; CHECK-NEXT: ushll v0.8h, v0.8b, #0 | ||
| ; CHECK-NEXT: dup v2.8h, w8 | ||
| ; CHECK-NEXT: umull2 v3.4s, v1.8h, v2.8h | ||
| ; CHECK-NEXT: umull v1.4s, v1.4h, v2.4h | ||
| ; CHECK-NEXT: umull2 v4.4s, v0.8h, v2.8h | ||
| ; CHECK-NEXT: umull v0.4s, v0.4h, v2.4h | ||
| ; CHECK-NEXT: uzp2 v1.8h, v1.8h, v3.8h | ||
| ; CHECK-NEXT: uzp2 v0.8h, v0.8h, v4.8h | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| %zext = zext <16 x i8> %x to <16 x i16> | ||
| %div = udiv <16 x i16> %zext, splat (i16 3) | ||
| ret <16 x i16> %div | ||
| } | ||
|
|
||
| define <16 x i16> @sdiv_v16i16_from_sext(<16 x i8> %x) { | ||
| ; CHECK-LABEL: sdiv_v16i16_from_sext: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: mov w8, #21846 // =0x5556 | ||
| ; CHECK-NEXT: sshll2 v1.8h, v0.16b, #0 | ||
| ; CHECK-NEXT: sshll v0.8h, v0.8b, #0 | ||
| ; CHECK-NEXT: dup v2.8h, w8 | ||
| ; CHECK-NEXT: smull2 v3.4s, v1.8h, v2.8h | ||
| ; CHECK-NEXT: smull v1.4s, v1.4h, v2.4h | ||
| ; CHECK-NEXT: smull2 v4.4s, v0.8h, v2.8h | ||
| ; CHECK-NEXT: smull v0.4s, v0.4h, v2.4h | ||
| ; CHECK-NEXT: uzp2 v1.8h, v1.8h, v3.8h | ||
| ; CHECK-NEXT: uzp2 v0.8h, v0.8h, v4.8h | ||
| ; CHECK-NEXT: usra v1.8h, v1.8h, #15 | ||
| ; CHECK-NEXT: usra v0.8h, v0.8h, #15 | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| %sext = sext <16 x i8> %x to <16 x i16> | ||
| %div = sdiv <16 x i16> %sext, splat (i16 3) | ||
| ret <16 x i16> %div | ||
| } | ||
|
|
||
| define <16 x i16> @udiv_exact_v16i16_from_zext(<16 x i8> %x) { | ||
| ; CHECK-LABEL: udiv_exact_v16i16_from_zext: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: mov w8, #43691 // =0xaaab | ||
| ; CHECK-NEXT: ushll v2.8h, v0.8b, #0 | ||
| ; CHECK-NEXT: ushll2 v0.8h, v0.16b, #0 | ||
| ; CHECK-NEXT: dup v3.8h, w8 | ||
| ; CHECK-NEXT: mul v1.8h, v0.8h, v3.8h | ||
| ; CHECK-NEXT: mul v0.8h, v2.8h, v3.8h | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| %zext = zext <16 x i8> %x to <16 x i16> | ||
| %div = udiv exact <16 x i16> %zext, splat (i16 3) | ||
| ret <16 x i16> %div | ||
| } | ||
|
|
||
| define <16 x i16> @sdiv_exact_v16i16_from_sext(<16 x i8> %x) { | ||
| ; CHECK-LABEL: sdiv_exact_v16i16_from_sext: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: mov w8, #43691 // =0xaaab | ||
| ; CHECK-NEXT: sshll v2.8h, v0.8b, #0 | ||
| ; CHECK-NEXT: sshll2 v0.8h, v0.16b, #0 | ||
| ; CHECK-NEXT: dup v3.8h, w8 | ||
| ; CHECK-NEXT: mul v1.8h, v0.8h, v3.8h | ||
| ; CHECK-NEXT: mul v0.8h, v2.8h, v3.8h | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| %sext = sext <16 x i8> %x to <16 x i16> | ||
| %div = sdiv exact <16 x i16> %sext, splat (i16 3) | ||
| ret <16 x i16> %div | ||
| } | ||
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.