-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AArch64][GISel] Don't crash in known-bits when copying from vectors to non-vectors #168081
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 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
50 changes: 50 additions & 0 deletions
50
llvm/test/CodeGen/AArch64/GlobalISel/knownbits-copy-vector-crash.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,50 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 | ||
| ; RUN: llc -O3 -o - %s | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" | ||
cofibrant marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| target triple = "aarch64-unknown-unknown" | ||
|
|
||
| ; Check we don't crash here when computing known bits. | ||
|
|
||
| define <4 x i32> @test(<8 x i16> %in, i1 %continue) { | ||
| ; CHECK-LABEL: test: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: sub sp, sp, #32 | ||
| ; CHECK-NEXT: .cfi_def_cfa_offset 32 | ||
| ; CHECK-NEXT: mov w9, wzr | ||
| ; CHECK-NEXT: .LBB0_1: // %loop | ||
| ; CHECK-NEXT: // =>This Inner Loop Header: Depth=1 | ||
| ; CHECK-NEXT: mov w8, w9 | ||
| ; CHECK-NEXT: mov x9, sp | ||
| ; CHECK-NEXT: str q0, [sp] | ||
| ; CHECK-NEXT: bfi x9, x8, #1, #3 | ||
| ; CHECK-NEXT: movi v1.2d, #0000000000000000 | ||
| ; CHECK-NEXT: ldrh w9, [x9] | ||
| ; CHECK-NEXT: tst w9, #0xff | ||
| ; CHECK-NEXT: cset w9, eq | ||
| ; CHECK-NEXT: mov v1.h[0], w9 | ||
| ; CHECK-NEXT: xtn v1.8b, v1.8h | ||
| ; CHECK-NEXT: fmov w9, s1 | ||
| ; CHECK-NEXT: tbz w0, #0, .LBB0_1 | ||
| ; CHECK-NEXT: // %bb.2: // %exit | ||
| ; CHECK-NEXT: movi v0.2d, #0000000000000000 | ||
| ; CHECK-NEXT: mov v0.s[0], w8 | ||
| ; CHECK-NEXT: add sp, sp, #32 | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| br label %loop | ||
|
|
||
| exit: | ||
| %result = insertelement <4 x i32> zeroinitializer, i32 %index, i64 0 | ||
| ret <4 x i32> %result | ||
|
|
||
| loop: | ||
| %index = phi i32 [ 0, %entry ], [ %insert.bitcast, %loop ] | ||
| %extracted = extractelement <8 x i16> %in, i32 %index | ||
| %masked = and i16 %extracted, 255 | ||
| %maskedIsZero = icmp eq i16 %masked, 0 | ||
| %maskedIsZero.zext = zext i1 %maskedIsZero to i8 | ||
| %insert = insertelement <4 x i8> zeroinitializer, i8 %maskedIsZero.zext, i64 0 | ||
| %insert.bitcast = bitcast <4 x i8> %insert to i32 | ||
| br i1 %continue, label %exit, label %loop | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.